org.ka2ddo.yaac.osm
Class Weight
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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)
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.