Package gnu.math
Class BaseUnit
java.lang.Object
java.lang.Number
gnu.math.Numeric
gnu.math.Quantity
gnu.math.Unit
gnu.math.NamedUnit
gnu.math.BaseUnit
- All Implemented Interfaces:
Externalizable
,Serializable
A primitive Unit of measurement (such as a meter).
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class gnu.math.Unit
define, define, dimensions, divide, doubleValue, isExact, isZero, number, pow, power, sqrt, times, toString, toString, toString
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
-
Constructor Details
-
BaseUnit
public BaseUnit()Should only be used for serialization, and Unit.Empty. -
BaseUnit
-
BaseUnit
-
-
Method Details
-
getDimension
-
init
protected void init() -
hashCode
public int hashCode() -
unit
-
lookup
Look for an existing matching BaseUnit.- Parameters:
name
- name of desired BaseUnit, such as "m"dimension
- a name for what the unit measures, such as "Length".
-
make
-
compare
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classNamedUnit
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classNamedUnit
- Throws:
IOException
ClassNotFoundException
-
readResolve
- Overrides:
readResolve
in classNamedUnit
- Throws:
ObjectStreamException
-