net.sf.magnitude.core
Enum BaseUnits

java.lang.Object
  extended by java.lang.Enum<BaseUnits>
      extended by net.sf.magnitude.core.BaseUnits
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BaseUnits>

public enum BaseUnits
extends java.lang.Enum<BaseUnits>

Base units for the Magnitude class.

Author:
Marin Lagacé

Enum Constant Summary
A
          Ampere.
CD
          Candela.
K
          Kelvin.
KG
          Kilogramme.
M
          Meter.
MOL
          Mole.
PX
          Pixel.
RAD
          Radian.
S
          Second.
SR
          Steradian.
 
Method Summary
 int getIndex()
          Returns the index of the unit in the base unit exponent array of Magnitudes.
static BaseUnits valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BaseUnits[] 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

KG

public static final BaseUnits KG
Kilogramme.


M

public static final BaseUnits M
Meter.


S

public static final BaseUnits S
Second.


K

public static final BaseUnits K
Kelvin.


A

public static final BaseUnits A
Ampere.


MOL

public static final BaseUnits MOL
Mole.


CD

public static final BaseUnits CD
Candela.


RAD

public static final BaseUnits RAD
Radian.


SR

public static final BaseUnits SR
Steradian.


PX

public static final BaseUnits PX
Pixel.

Method Detail

values

public static BaseUnits[] 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 (BaseUnits c : BaseUnits.values())
    System.out.println(c);

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

valueOf

public static BaseUnits valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getIndex

public int getIndex()
Returns the index of the unit in the base unit exponent array of Magnitudes.

Returns:
the index of the unit.