|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<WeightUnit>
org.ka2ddo.util.WeightUnit
public enum WeightUnit
This enumeration declares units (with conversion factors) for measuring weights (including units of mass that are used for weight in one standard Earth gravity).
Enum Constant Summary | |
---|---|
KILOGRAM
Weights in kilograms. |
|
METRIC_TON
Weights in metric tons. |
|
POUND
Weights in pounds. |
|
TON
Weights in short tons, |
Method Summary | |
---|---|
float |
from(WeightUnit other)
Get the multiplicative conversion factor to convert a weight from the specified units to this unit. |
java.lang.String |
getAbbreviation()
Get short standard abbreviation for this WeightUnit. |
static WeightUnit[] |
getHeavyWeightUnits()
Get the units of weight that are "heavy" (enough for a motorized vehicle). |
float |
getOffset(WeightUnit other)
Get the additive offset to convert a value from the specified unit to this unit. |
static WeightUnit |
getUnitForName(java.lang.String name)
Get the enumeration corresponding to the specified weight unit String name. |
static WeightUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static WeightUnit[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final WeightUnit POUND
public static final WeightUnit KILOGRAM
public static final WeightUnit TON
public static final WeightUnit METRIC_TON
Method Detail |
---|
public static WeightUnit[] values()
for (WeightUnit c : WeightUnit.values()) System.out.println(c);
public static WeightUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic final float from(WeightUnit other)
from
in interface UnitEnum<WeightUnit>
other
- another WeightUnit representing the existing units of a Weight value
public float getOffset(WeightUnit other)
getOffset
in interface UnitEnum<WeightUnit>
other
- another WeightUnit representing the existing units of a value
public java.lang.String getAbbreviation()
public static WeightUnit getUnitForName(java.lang.String name)
name
- String to convert inti a WeightUnit
public static WeightUnit[] getHeavyWeightUnits()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |