com.sun.electric.database.text
Class TextUtils.UnitScale

java.lang.Object
  extended by com.sun.electric.database.text.TextUtils.UnitScale
Enclosing class:
TextUtils

public static class TextUtils.UnitScale
extends java.lang.Object

Unit is a typesafe enum class that describes a unit scale (metric factors of 10).


Field Summary
static TextUtils.UnitScale ATTO
          Describes atto scale (10 to the -18th).
static TextUtils.UnitScale FEMTO
          Describes femto scale (10 to the -15th).
static TextUtils.UnitScale GIGA
          Describes giga scale (1 billion).
static TextUtils.UnitScale KILO
          Describes kilo scale (1 thousand).
static TextUtils.UnitScale MEGA
          Describes mega scale (1 million).
static TextUtils.UnitScale MICRO
          Describes micro scale (1 millionth).
static TextUtils.UnitScale MILLI
          Describes milli scale (1 thousandth).
static TextUtils.UnitScale NANO
          Describes nano scale (1 billionth).
static TextUtils.UnitScale NONE
          Describes unit scale (1).
static TextUtils.UnitScale PICO
          Describes pico scale (10 to the -12th).
static TextUtils.UnitScale YOCTO
          Describes yocto scale (10 to the -24th).
static TextUtils.UnitScale ZEPTO
          Describes zepto scale (10 to the -21st).
 
Method Summary
static TextUtils.UnitScale findFromIndex(int index)
          Method to convert the index value to a UnitScale.
 int getIndex()
          Method to convert this UnitScale to an integer.
 java.lang.Number getMultiplier()
          Get the multiplier value associated with this unit scale.
 java.lang.String getName()
          Method to return the name of this UnitScale.
 java.lang.String getPostFix()
          Get the string representing the postfix associated with this unit scale
static TextUtils.UnitScale[] getUnitScales()
          Method to return a list of all scales.
 java.lang.String toString()
          Returns a printable version of this Unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GIGA

public static final TextUtils.UnitScale GIGA
Describes giga scale (1 billion).


MEGA

public static final TextUtils.UnitScale MEGA
Describes mega scale (1 million).


KILO

public static final TextUtils.UnitScale KILO
Describes kilo scale (1 thousand).


NONE

public static final TextUtils.UnitScale NONE
Describes unit scale (1).


MILLI

public static final TextUtils.UnitScale MILLI
Describes milli scale (1 thousandth).


MICRO

public static final TextUtils.UnitScale MICRO
Describes micro scale (1 millionth).


NANO

public static final TextUtils.UnitScale NANO
Describes nano scale (1 billionth).


PICO

public static final TextUtils.UnitScale PICO
Describes pico scale (10 to the -12th).


FEMTO

public static final TextUtils.UnitScale FEMTO
Describes femto scale (10 to the -15th).


ATTO

public static final TextUtils.UnitScale ATTO
Describes atto scale (10 to the -18th).


ZEPTO

public static final TextUtils.UnitScale ZEPTO
Describes zepto scale (10 to the -21st).


YOCTO

public static final TextUtils.UnitScale YOCTO
Describes yocto scale (10 to the -24th).

Method Detail

getName

public java.lang.String getName()
Method to return the name of this UnitScale. The name can be prepended to a type, for example the name "Milli" can be put in front of "Meter".

Returns:
the name of this UnitScale.

getIndex

public int getIndex()
Method to convert this UnitScale to an integer. Used when storing these as preferences.

Returns:
the index of this UnitScale.

getPostFix

public java.lang.String getPostFix()
Get the string representing the postfix associated with this unit scale

Returns:
the post fix string

getMultiplier

public java.lang.Number getMultiplier()
Get the multiplier value associated with this unit scale.

Returns:
the multiplier. May be an Integer (values >= 1) or a Double (values <= 1)

findFromIndex

public static TextUtils.UnitScale findFromIndex(int index)
Method to convert the index value to a UnitScale. Used when storing these as preferences.

Parameters:
index - the index of the UnitScale.
Returns:
the indexed UnitScale.

getUnitScales

public static TextUtils.UnitScale[] getUnitScales()
Method to return a list of all scales.

Returns:
an array of all scales.

toString

public java.lang.String toString()
Returns a printable version of this Unit.

Overrides:
toString in class java.lang.Object
Returns:
a printable version of this Unit.