gnu.math

Class NamedUnit

Implemented Interfaces:
Externalizable
Known Direct Subclasses:
BaseUnit

public class NamedUnit
extends Unit
implements Externalizable

A Unit that has a name.

Field Summary

Fields inherited from class gnu.math.Unit

Empty, cm, gram, hour, in, meter, minute, mm, pica, pt, radian, second

Fields inherited from class gnu.math.Numeric

CEILING, FLOOR, ROUND, TRUNCATE

Constructor Summary

NamedUnit()
NamedUnit(String name, double factor, Unit base)
NamedUnit(String name, DQuantity value)

Method Summary

String
getName()
protected void
init()
static NamedUnit
lookup(String name)
static NamedUnit
lookup(String name, double scale, Unit base)
static NamedUnit
make(String name, double scale, Unit base)
static NamedUnit
make(String name, Quantity value)
void
readExternal(ObjectInput in)
Object
readResolve()
void
writeExternal(ObjectOutput out)

Methods inherited from class gnu.math.Unit

define, define, dimensions, divide, doubleValue, getName, hashCode, isExact, isZero, lookup, make, number, pow, power, sqrt, times, toString, toString, toString, unit

Methods inherited from class gnu.math.Quantity

abs, add, add, addReversed, compare, compare, compareReversed, dimensions, div, divReversed, divide, doubleImagValue, doubleValue, im, imValue, make, make, make, mul, mulReversed, neg, number, re, reValue, times, toString, unit

Methods inherited from class gnu.math.Numeric

abs, add, add, addReversed, compare, compareReversed, div, divReversed, div_inv, equals, floatValue, geq, grt, intValue, isExact, isZero, longValue, mul, mulReversed, mul_ident, neg, power, sub, toString, toString

Constructor Details

NamedUnit

public NamedUnit()

NamedUnit

public NamedUnit(String name,
                 double factor,
                 Unit base)

NamedUnit

public NamedUnit(String name,
                 DQuantity value)

Method Details

getName

public String getName()
Overrides:
getName in interface Unit

init

protected void init()

lookup

public static NamedUnit lookup(String name)
Overrides:
lookup in interface Unit

lookup

public static NamedUnit lookup(String name,
                               double scale,
                               Unit base)

make

public static NamedUnit make(String name,
                             double scale,
                             Unit base)

make

public static NamedUnit make(String name,
                             Quantity value)
Overrides:
make in interface Unit

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException

readResolve

public Object readResolve()
            throws ObjectStreamException

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException