org.openwms.common.domain.values
Enum WeightUnit

java.lang.Object
  extended by java.lang.Enum<WeightUnit>
      extended by org.openwms.common.domain.values.WeightUnit
All Implemented Interfaces:
Serializable, Comparable<WeightUnit>, UnitType

public enum WeightUnit
extends Enum<WeightUnit>
implements UnitType

A WeightUnit is a concrete set of all possible weights.

In SI format.

Since:
0.1
Version:
$Revision: 1594 $
Author:
Heiko Scherrer

Enum Constant Summary
G
          Gram.
KG
          Kilogram.
MG
          Milligram.
T
          Tons.
 
Method Summary
 List<UnitType> getAll()
          Return all sub types of the UnitType.
 UnitType getBaseUnit()
          Return the base unit type of the UnitType.
 long getBaseUnitValue()
          Return the value of the base unit.
static WeightUnit valueOf(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

MG

public static final WeightUnit MG
Milligram.


G

public static final WeightUnit G
Gram.


KG

public static final WeightUnit KG
Kilogram.


T

public static final WeightUnit T
Tons.

Method Detail

values

public static WeightUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (WeightUnit c : WeightUnit.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WeightUnit valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getBaseUnitValue

public long getBaseUnitValue()
Return the value of the base unit.

Specified by:
getBaseUnitValue in interface UnitType
Returns:
The value of the base unit

getAll

public List<UnitType> getAll()
Return all sub types of the UnitType.

Specified by:
getAll in interface UnitType
Returns:
a list of sub types

getBaseUnit

public UnitType getBaseUnit()
Return the base unit type of the UnitType.

Specified by:
getBaseUnit in interface UnitType
Returns:
The base unit type


Copyright © 2005-2011 openwms.org. All Rights Reserved.