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, toStringMethods 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, toStringMethods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, equals, floatValue, geq, grt, intValue, longValue, mul_ident, sub, toExact, toInexactMethods 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:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classNamedUnit- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classNamedUnit- Throws:
IOExceptionClassNotFoundException
-
readResolve
- Overrides:
readResolvein classNamedUnit- Throws:
ObjectStreamException
-