Package com.globalmentor.si
Enum SIPrefix
- java.lang.Object
-
- java.lang.Enum<SIPrefix>
-
- com.globalmentor.si.SIPrefix
-
- All Implemented Interfaces:
Named<java.lang.String>
,java.io.Serializable
,java.lang.Comparable<SIPrefix>
public enum SIPrefix extends java.lang.Enum<SIPrefix> implements Named<java.lang.String>
A prefix of the International System of Units codified by ISO 30. The prefixes appear in the order of smallest to largest factor.- Author:
- Garret Wilson
- See Also:
- SI prefix, International System of Units
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimal
getFactor()
int
getFactorPower()
java.lang.String
getName()
java.lang.String
getSymbol()
java.lang.String
toString()
Returns a string representation of the prefix.static SIPrefix
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static SIPrefix[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
YOCTO
public static final SIPrefix YOCTO
-
ZEPTO
public static final SIPrefix ZEPTO
-
ATTO
public static final SIPrefix ATTO
-
FEMTO
public static final SIPrefix FEMTO
-
PICO
public static final SIPrefix PICO
-
NANO
public static final SIPrefix NANO
-
MICRO
public static final SIPrefix MICRO
-
MILLI
public static final SIPrefix MILLI
-
CENTI
public static final SIPrefix CENTI
-
DECI
public static final SIPrefix DECI
-
NONE
public static final SIPrefix NONE
-
DECA
public static final SIPrefix DECA
-
HECTO
public static final SIPrefix HECTO
-
KILO
public static final SIPrefix KILO
-
MEGA
public static final SIPrefix MEGA
-
GIGA
public static final SIPrefix GIGA
-
TERA
public static final SIPrefix TERA
-
PETA
public static final SIPrefix PETA
-
EXA
public static final SIPrefix EXA
-
ZETTA
public static final SIPrefix ZETTA
-
YOTTA
public static final SIPrefix YOTTA
-
-
Method Detail
-
values
public static SIPrefix[] 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 (SIPrefix c : SIPrefix.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SIPrefix 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 namejava.lang.NullPointerException
- if the argument is null
-
getName
public java.lang.String getName()
-
getSymbol
public java.lang.String getSymbol()
- Returns:
- The prefix symbol.
-
getFactorPower
public int getFactorPower()
- Returns:
- The power of the prefix factor with 10 as the base.
-
getFactor
public java.math.BigDecimal getFactor()
- Returns:
- The power of the prefix.
-
-