gnu.math
Class NamedUnit

java.lang.Object
  extended by java.lang.Number
      extended by gnu.math.Numeric
          extended by gnu.math.Quantity
              extended by gnu.math.Unit
                  extended by gnu.math.NamedUnit
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
BaseUnit

public class NamedUnit
extends Unit
implements java.io.Externalizable

A Unit that has a name.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gnu.math.Unit
cm, Empty, 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(java.lang.String name, double factor, Unit base)
           
NamedUnit(java.lang.String name, DQuantity value)
           
 
Method Summary
 java.lang.String getName()
           
protected  void init()
           
static NamedUnit lookup(java.lang.String name)
           
static NamedUnit lookup(java.lang.String name, double scale, Unit base)
           
static NamedUnit make(java.lang.String name, double scale, Unit base)
           
static NamedUnit make(java.lang.String name, Quantity value)
           
 void readExternal(java.io.ObjectInput in)
           
 java.lang.Object readResolve()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class gnu.math.Unit
define, define, dimensions, divide, doubleValue, hashCode, isExact, isZero, number, pow, power, sqrt, times, toString, toString, toString, unit
 
Methods inherited from class gnu.math.Quantity
abs, add, add, addReversed, compare, compare, compareReversed, div, divide, divReversed, doubleImagValue, im, imValue, make, make, make, mul, mulReversed, neg, re, reValue, times, toString
 
Methods inherited from class gnu.math.Numeric
add, div_inv, equals, floatValue, geq, grt, intValue, longValue, mul_ident, sub
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedUnit

public NamedUnit()

NamedUnit

public NamedUnit(java.lang.String name,
                 DQuantity value)

NamedUnit

public NamedUnit(java.lang.String name,
                 double factor,
                 Unit base)
Method Detail

init

protected void init()

getName

public java.lang.String getName()
Overrides:
getName in class Unit

lookup

public static NamedUnit lookup(java.lang.String name)

lookup

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

make

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

make

public static NamedUnit make(java.lang.String name,
                             Quantity value)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

readResolve

public java.lang.Object readResolve()
                             throws java.io.ObjectStreamException
Throws:
java.io.ObjectStreamException