Package gnu.math
Class Unit
java.lang.Object
java.lang.Number
gnu.math.Numeric
gnu.math.Quantity
gnu.math.Unit
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
NamedUnit
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Unit
static final NamedUnit
static final Unit
static final BaseUnit
static BaseUnit
static final Unit
static final BaseUnit
static final Unit
static final Unit
static final BaseUnit
static final Unit
static final Unit
static final NamedUnit
static double
A magic factor to indicate units that have the same "dimension" but not a fixed multiple.static final Unit
static final Unit
static final Unit
static final NamedUnit
-
Method Summary
Modifier and TypeMethodDescriptionstatic Unit
static Unit
final Dimensions
static Unit
final double
The value of the real component, as a double.getName()
int
hashCode()
boolean
isExact()
final boolean
isZero()
static NamedUnit
static NamedUnit
number()
static Unit
Return this raised to an integer power.sqrt()
static Unit
toString()
toString
(double val) unit()
Methods inherited from class gnu.math.Quantity
abs, add, add, addReversed, compare, compare, compareReversed, div, divide, divReversed, doubleImagValue, doubleJmagValue, doubleKmagValue, im, imValue, jm, jmValue, km, kmValue, make, make, make, mul, mulReversed, neg, re, reValue, times, toString
Methods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, equals, floatValue, geq, grt, intValue, longValue, mul_ident, sub, toExact, toInexact
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
Empty
-
NON_COMBINABLE
public static double NON_COMBINABLEA magic factor to indicate units that have the same "dimension" but not a fixed multiple. E.g. "month" and "day", or money of different currencies. Since they have the same dimension, they can be added to get an (unimplemented) combined quantity, but they cannot be compared. No general support yet, but used for time Duration. -
meter
-
duration
-
gram
-
cm
-
mm
-
in
-
pt
-
pica
-
radian
-
degree
-
gradian
-
date
-
second
-
month
-
minute
-
hour
-
-
Method Details
-
dimensions
- Overrides:
dimensions
in classQuantity
-
doubleValue
public final double doubleValue()Description copied from class:Quantity
The value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleValue
in classQuantity
-
hashCode
public int hashCode() -
getName
-
times
-
divide
-
pow
-
make
-
define
-
define
-
number
-
isExact
public boolean isExact() -
isZero
public final boolean isZero() -
power
Description copied from class:Numeric
Return this raised to an integer power. Implemented by repeated squaring and multiplication. Ify < 0
, returns div_inv of the result. -
sqrt
-
lookup
-
toString
-
toString
-
toString
-
unit
-