de.grogra.util
Class Quantity

java.lang.Object
  extended by de.grogra.util.Quantity

public final class Quantity
extends java.lang.Object


Field Summary
static Quantity ANGLE
           
static Quantity FRACTION
           
static Quantity LENGTH
           
static Quantity MASS
           
static Quantity POWER
           
static Quantity POWER_PER_AREA
           
static Quantity TEMPERATURE
           
static Quantity TIME
           
 
Method Summary
 void add(java.lang.String unit, double factor)
           
 void add(Unit unit)
           
 Unit chooseUnit(float value)
           
 boolean equals(java.lang.Object o)
           
static Quantity get(java.lang.String name)
           
 Unit getPreferredUnit()
           
 Unit[] getUnits()
           
 int hashCode()
           
 Quantity newInstance(Unit preferredUnit)
           
 Unit parseUnit(java.lang.String s)
           
 Unit parseUnit(java.lang.String s, Unit defaultUnit)
           
 java.lang.String toString(double value)
           
 java.lang.String toString(float value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANGLE

public static final Quantity ANGLE

FRACTION

public static final Quantity FRACTION

LENGTH

public static final Quantity LENGTH

MASS

public static final Quantity MASS

POWER

public static final Quantity POWER

POWER_PER_AREA

public static final Quantity POWER_PER_AREA

TEMPERATURE

public static final Quantity TEMPERATURE

TIME

public static final Quantity TIME
Method Detail

add

public void add(java.lang.String unit,
                double factor)

add

public void add(Unit unit)

chooseUnit

public Unit chooseUnit(float value)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

get

public static Quantity get(java.lang.String name)

getPreferredUnit

public Unit getPreferredUnit()

getUnits

public Unit[] getUnits()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

newInstance

public Quantity newInstance(Unit preferredUnit)

parseUnit

public Unit parseUnit(java.lang.String s)

parseUnit

public Unit parseUnit(java.lang.String s,
                      Unit defaultUnit)

toString

public java.lang.String toString(double value)

toString

public java.lang.String toString(float value)