org.openmuc.core.measurement
Enum Unit

java.lang.Object
  extended by java.lang.Enum<Unit>
      extended by org.openmuc.core.measurement.Unit
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Unit>

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

This enum represents a measurement unit. It should be compatible with the DLMS unit codes according to IEC 62056-62. It is aimed to replace the former DLMSUnit class


Enum Constant Summary
ACTIVE_ENERGY_METER_CONSTANT_OR_PULSE_VALUE
           
AMPERE
           
AMPERE_HOUR
           
AMPERE_PER_METRE
           
AMPERE_SQUARED_HOUR_METER_CONSTANT_OR_PULSE_VALUE
           
AMPERE_SQUARED_HOURS
           
APPARENT_ENERGY_METER_CONSTANT_OR_PULSE_VALUE
           
BAR
           
CALORIFIC_VALUE
           
COULOMB
           
COUNT
           
CUBIC_METRE
           
CUBIC_METRE_CORRECTED
           
CUBIC_METRE_PER_DAY
           
CUBIC_METRE_PER_DAY_CORRECTED
           
CUBIC_METRE_PER_HOUR
           
CUBIC_METRE_PER_HOUR_CORRECTED
           
CUBIC_METRE_PER_MINUTE
           
CUBIC_METRE_PER_SECOND
           
CURRENCY
           
DAY
           
DEGREE
           
DEGREE_CELSIUS
           
ENERGY_PER_VOLUME
           
FARAD
           
HENRY
           
HERTZ
           
HOUR
           
JOULE
           
JOULE_PER_HOUR
           
KELVIN
           
KILOGRAM
           
KILOGRAM_PER_HOUR
           
KILOGRAM_PER_SECOND
           
LITRE
           
MASS_DENSITY
           
METER_CONSTANT_OR_PULSE_VALUE
           
METRE
           
METRE_PER_SECOND
           
MIN
           
MOLE_PERCENT
           
MONTH
           
NEWTON
           
NEWTONMETER
           
OHM
           
OHM_METRE
           
OTHER_UNIT
           
PASCAL
           
PASCAL_SECOND
           
PERCENTAGE
           
REACTIVE_ENERGY_METER_CONSTANT_OR_PULSE_VALUE
           
RESERVED
           
SECOND
           
TESLA
           
UNKNOWN
           
VAR
           
VAR_HOUR
           
VOLT
           
VOLT_AMPERE
           
VOLT_AMPERE_HOUR
           
VOLT_PER_METRE
           
VOLT_SQUARED_HOUR_METER_CONSTANT_OR_PULSE_VALUE
           
VOLT_SQUARED_HOURS
           
WATT
           
WATT_HOUR
           
WEBER
           
WEEK
           
YEAR
           
 
Method Summary
static Unit fromUnitCode(int code)
           
static java.lang.String getString(Unit unit)
           
 int getUnitCode()
          Returns the code of the unit according to DLMS.
 java.lang.String toString()
           
static Unit valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Unit[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNKNOWN

public static final Unit UNKNOWN

YEAR

public static final Unit YEAR

MONTH

public static final Unit MONTH

WEEK

public static final Unit WEEK

DAY

public static final Unit DAY

HOUR

public static final Unit HOUR

MIN

public static final Unit MIN

SECOND

public static final Unit SECOND

DEGREE

public static final Unit DEGREE

DEGREE_CELSIUS

public static final Unit DEGREE_CELSIUS

CURRENCY

public static final Unit CURRENCY

METRE

public static final Unit METRE

METRE_PER_SECOND

public static final Unit METRE_PER_SECOND

CUBIC_METRE

public static final Unit CUBIC_METRE

CUBIC_METRE_CORRECTED

public static final Unit CUBIC_METRE_CORRECTED

CUBIC_METRE_PER_HOUR

public static final Unit CUBIC_METRE_PER_HOUR

CUBIC_METRE_PER_HOUR_CORRECTED

public static final Unit CUBIC_METRE_PER_HOUR_CORRECTED

CUBIC_METRE_PER_DAY

public static final Unit CUBIC_METRE_PER_DAY

CUBIC_METRE_PER_DAY_CORRECTED

public static final Unit CUBIC_METRE_PER_DAY_CORRECTED

LITRE

public static final Unit LITRE

KILOGRAM

public static final Unit KILOGRAM

NEWTON

public static final Unit NEWTON

NEWTONMETER

public static final Unit NEWTONMETER

PASCAL

public static final Unit PASCAL

BAR

public static final Unit BAR

JOULE

public static final Unit JOULE

JOULE_PER_HOUR

public static final Unit JOULE_PER_HOUR

WATT

public static final Unit WATT

VOLT_AMPERE

public static final Unit VOLT_AMPERE

VAR

public static final Unit VAR

WATT_HOUR

public static final Unit WATT_HOUR

VOLT_AMPERE_HOUR

public static final Unit VOLT_AMPERE_HOUR

VAR_HOUR

public static final Unit VAR_HOUR

AMPERE

public static final Unit AMPERE

COULOMB

public static final Unit COULOMB

VOLT

public static final Unit VOLT

VOLT_PER_METRE

public static final Unit VOLT_PER_METRE

FARAD

public static final Unit FARAD

OHM

public static final Unit OHM

OHM_METRE

public static final Unit OHM_METRE

WEBER

public static final Unit WEBER

TESLA

public static final Unit TESLA

AMPERE_PER_METRE

public static final Unit AMPERE_PER_METRE

HENRY

public static final Unit HENRY

HERTZ

public static final Unit HERTZ

ACTIVE_ENERGY_METER_CONSTANT_OR_PULSE_VALUE

public static final Unit ACTIVE_ENERGY_METER_CONSTANT_OR_PULSE_VALUE

REACTIVE_ENERGY_METER_CONSTANT_OR_PULSE_VALUE

public static final Unit REACTIVE_ENERGY_METER_CONSTANT_OR_PULSE_VALUE

APPARENT_ENERGY_METER_CONSTANT_OR_PULSE_VALUE

public static final Unit APPARENT_ENERGY_METER_CONSTANT_OR_PULSE_VALUE

VOLT_SQUARED_HOURS

public static final Unit VOLT_SQUARED_HOURS

AMPERE_SQUARED_HOURS

public static final Unit AMPERE_SQUARED_HOURS

KILOGRAM_PER_SECOND

public static final Unit KILOGRAM_PER_SECOND

KELVIN

public static final Unit KELVIN

VOLT_SQUARED_HOUR_METER_CONSTANT_OR_PULSE_VALUE

public static final Unit VOLT_SQUARED_HOUR_METER_CONSTANT_OR_PULSE_VALUE

AMPERE_SQUARED_HOUR_METER_CONSTANT_OR_PULSE_VALUE

public static final Unit AMPERE_SQUARED_HOUR_METER_CONSTANT_OR_PULSE_VALUE

METER_CONSTANT_OR_PULSE_VALUE

public static final Unit METER_CONSTANT_OR_PULSE_VALUE

PERCENTAGE

public static final Unit PERCENTAGE

AMPERE_HOUR

public static final Unit AMPERE_HOUR

ENERGY_PER_VOLUME

public static final Unit ENERGY_PER_VOLUME

CALORIFIC_VALUE

public static final Unit CALORIFIC_VALUE

MOLE_PERCENT

public static final Unit MOLE_PERCENT

MASS_DENSITY

public static final Unit MASS_DENSITY

PASCAL_SECOND

public static final Unit PASCAL_SECOND

RESERVED

public static final Unit RESERVED

OTHER_UNIT

public static final Unit OTHER_UNIT

COUNT

public static final Unit COUNT

CUBIC_METRE_PER_SECOND

public static final Unit CUBIC_METRE_PER_SECOND

CUBIC_METRE_PER_MINUTE

public static final Unit CUBIC_METRE_PER_MINUTE

KILOGRAM_PER_HOUR

public static final Unit KILOGRAM_PER_HOUR
Method Detail

values

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

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

valueOf

public static Unit 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

getUnitCode

public int getUnitCode()
Returns the code of the unit according to DLMS.

Returns:
unit code as int

fromUnitCode

public static Unit fromUnitCode(int code)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<Unit>

getString

public static java.lang.String getString(Unit unit)