gnu.math
public class BaseUnit extends NamedUnit implements Externalizable
Constructor Summary | |
---|---|
BaseUnit() Should only be used for serialization, and Unit.Empty. | |
BaseUnit(String name) | |
BaseUnit(String name, String dimension) |
Method Summary | |
---|---|
static int | compare(BaseUnit unit1, BaseUnit unit2) |
String | getDimension() |
int | hashCode() |
protected void | init() |
static BaseUnit | lookup(String name, String dimension) Look for an existing matching BaseUnit. |
static BaseUnit | make(String name, String dimension) |
void | readExternal(ObjectInput in) |
Object | readResolve() |
Unit | unit() |
void | writeExternal(ObjectOutput out) |
Parameters: name name of desired BaseUnit, such as "m" dimension a name for what the unit measures, such as "Length".
Serial Data: Write the unit name (using writeUTF), followed. followed by the name of the dimension it is a unit for. The latter is either null or a String and is written with writeObject.