com.tensegrity.generic.util.metric
Class MetricConstants

java.lang.Object
  extended bycom.tensegrity.generic.util.metric.MetricConstants

public final class MetricConstants
extends java.lang.Object

The MetricConstants class provides the constants and conversion methods that are needed to work with metric expressions.

Version:
$Id: MetricConstants.java,v 1.6 2006/01/26 15:32:26 MichaelKegel Exp $
Author:
MKegel

Field Summary
static int CENTIMETER
          Constants defining one of the supported measuring units
static java.lang.String CENTIMETER_ABBR
          Constants defining the here used abbreviation for the used units
static int INCH
          Constants defining one of the supported measuring units
static java.lang.String INCH_ABBR
          Constants defining the here used abbreviation for the used units
static int INTERN
          Constants defining one of the supported measuring units
static java.lang.String INTERN_ABBR
          Constants defining the here used abbreviation for the used units
static int MILLIMETER
          Constants defining one of the supported measuring units
static int MILLIMETER_10
          Constants defining one of the supported measuring units
static java.lang.String MILLIMETER_10_ABBR
          Constants defining the here used abbreviation for the used units
static int MILLIMETER_100
          Constants defining one of the supported measuring units
static java.lang.String MILLIMETER_100_ABBR
          Constants defining the here used abbreviation for the used units
static java.lang.String MILLIMETER_ABBR
          Constants defining the here used abbreviation for the used units
 
Method Summary
static java.lang.String[] getUnitAbbreviations()
          Returns all the unit abbreviations as an array of String.
static int unit2Constant(java.lang.String abbr)
          Returns the corresponding constant for the given abbreviation.
static java.lang.String unit2String(int unit)
          Returns a human readable abbreviation of the measuring unit of the given metric constant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CENTIMETER

public static final int CENTIMETER
Constants defining one of the supported measuring units

See Also:
Constant Field Values

MILLIMETER

public static final int MILLIMETER
Constants defining one of the supported measuring units

See Also:
Constant Field Values

MILLIMETER_10

public static final int MILLIMETER_10
Constants defining one of the supported measuring units

See Also:
Constant Field Values

MILLIMETER_100

public static final int MILLIMETER_100
Constants defining one of the supported measuring units

See Also:
Constant Field Values

INCH

public static final int INCH
Constants defining one of the supported measuring units

See Also:
Constant Field Values

INTERN

public static final int INTERN
Constants defining one of the supported measuring units

See Also:
Constant Field Values

CENTIMETER_ABBR

public static final java.lang.String CENTIMETER_ABBR
Constants defining the here used abbreviation for the used units

See Also:
Constant Field Values

MILLIMETER_ABBR

public static final java.lang.String MILLIMETER_ABBR
Constants defining the here used abbreviation for the used units

See Also:
Constant Field Values

MILLIMETER_10_ABBR

public static final java.lang.String MILLIMETER_10_ABBR
Constants defining the here used abbreviation for the used units

See Also:
Constant Field Values

MILLIMETER_100_ABBR

public static final java.lang.String MILLIMETER_100_ABBR
Constants defining the here used abbreviation for the used units

See Also:
Constant Field Values

INCH_ABBR

public static final java.lang.String INCH_ABBR
Constants defining the here used abbreviation for the used units

See Also:
Constant Field Values

INTERN_ABBR

public static final java.lang.String INTERN_ABBR
Constants defining the here used abbreviation for the used units

See Also:
Constant Field Values
Method Detail

unit2String

public static final java.lang.String unit2String(int unit)
Returns a human readable abbreviation of the measuring unit of the given metric constant.

Parameters:
unit - the unit constant to translate
Returns:
an abbreviation describing the current measure unit
Throws:
InvalidArgumentException - if the given measuring unit is unknown

unit2Constant

public static final int unit2Constant(java.lang.String abbr)
Returns the corresponding constant for the given abbreviation.

Parameters:
abbr - the abbreviation to look up the constant for
Returns:
the corresponding constant for the given abbreviation

getUnitAbbreviations

public static java.lang.String[] getUnitAbbreviations()
Returns all the unit abbreviations as an array of String.

Returns:
the unit names in no specific order as an array of String.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.