org.ka2ddo.yaac.osm
Class Weight

java.lang.Object
  extended by org.ka2ddo.yaac.osm.Weight
All Implemented Interfaces:
QuantityUnitMeasure<WeightUnit>

public class Weight
extends java.lang.Object
implements QuantityUnitMeasure<WeightUnit>

This class defines a compound object containing a weight value and the unit of weight.


Constructor Summary
Weight(float weight)
           
Weight(float weight, WeightUnit unit)
           
Weight(java.lang.String value)
           
 
Method Summary
 float getMagnitude()
           
 float getMagnitude(WeightUnit otherUnit)
           
 float getMagnitudeInDefaultUnit()
           
 WeightUnit getUnit()
           
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Weight

public Weight(java.lang.String value)
       throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

Weight

public Weight(float weight,
              WeightUnit unit)

Weight

public Weight(float weight)
Method Detail

getMagnitude

public float getMagnitude()
Specified by:
getMagnitude in interface QuantityUnitMeasure<WeightUnit>

getMagnitude

public float getMagnitude(WeightUnit otherUnit)
Specified by:
getMagnitude in interface QuantityUnitMeasure<WeightUnit>

getMagnitudeInDefaultUnit

public float getMagnitudeInDefaultUnit()
Specified by:
getMagnitudeInDefaultUnit in interface QuantityUnitMeasure<WeightUnit>

getUnit

public WeightUnit getUnit()
Specified by:
getUnit in interface QuantityUnitMeasure<WeightUnit>

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.