public class Weight extends java.lang.Object implements QuantityUnitMeasure<WeightUnit>
| Constructor and Description |
|---|
Weight(float weight) |
Weight(float weight,
WeightUnit unit) |
Weight(java.lang.String value) |
| Modifier and Type | Method and Description |
|---|---|
float |
getMagnitude() |
float |
getMagnitude(WeightUnit otherUnit) |
float |
getMagnitudeInDefaultUnit() |
WeightUnit |
getUnit() |
java.lang.String |
toString()
Returns a string representation of the object.
|
public Weight(java.lang.String value)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic Weight(float weight,
WeightUnit unit)
public Weight(float weight)
public float getMagnitude()
getMagnitude in interface QuantityUnitMeasure<WeightUnit>public float getMagnitude(WeightUnit otherUnit)
getMagnitude in interface QuantityUnitMeasure<WeightUnit>public float getMagnitudeInDefaultUnit()
getMagnitudeInDefaultUnit in interface QuantityUnitMeasure<WeightUnit>public WeightUnit getUnit()
getUnit in interface QuantityUnitMeasure<WeightUnit>public java.lang.String toString()
toString in class java.lang.Object