public class BaseUnit extends NamedUnit implements java.io.Externalizable
Constructor and Description |
---|
BaseUnit()
Should only be used for serialization, and Unit.Empty.
|
BaseUnit(java.lang.String name) |
BaseUnit(java.lang.String name,
java.lang.String dimension) |
Modifier and Type | Method and Description |
---|---|
static int |
compare(BaseUnit unit1,
BaseUnit unit2) |
java.lang.String |
getDimension() |
int |
hashCode() |
protected void |
init() |
static BaseUnit |
lookup(java.lang.String name,
java.lang.String dimension)
Look for an existing matching BaseUnit.
|
static BaseUnit |
make(java.lang.String name,
java.lang.String dimension) |
void |
readExternal(java.io.ObjectInput in) |
java.lang.Object |
readResolve() |
Unit |
unit() |
void |
writeExternal(java.io.ObjectOutput out) |
define, define, dimensions, divide, doubleValue, isExact, isZero, number, pow, power, sqrt, times, toString, toString, toString
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
public BaseUnit()
public BaseUnit(java.lang.String name)
public BaseUnit(java.lang.String name, java.lang.String dimension)
public java.lang.String getDimension()
public static BaseUnit lookup(java.lang.String name, java.lang.String dimension)
name
- name of desired BaseUnit, such as "m"dimension
- a name for what the unit measures, such as "Length".public static BaseUnit make(java.lang.String name, java.lang.String dimension)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class NamedUnit
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class NamedUnit
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object readResolve() throws java.io.ObjectStreamException
readResolve
in class NamedUnit
java.io.ObjectStreamException