Package org.openjdk.jmc.common.unit
Enum DecimalPrefix
- java.lang.Object
-
- java.lang.Enum<DecimalPrefix>
-
- org.openjdk.jmc.common.unit.DecimalPrefix
-
- All Implemented Interfaces:
Serializable,Comparable<DecimalPrefix>,IPrefix<DecimalPrefix>
public enum DecimalPrefix extends Enum<DecimalPrefix> implements IPrefix<DecimalPrefix>
Decimal prefixes, as standardized by SI. Extend functionality as needed, perhaps likeTimeUnit.- See Also:
BinaryPrefix
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaltSymbol()Intended to be used for parsing GUI strings where entering the micron character may be cumbersome.StringBuilderasExponentialStringBuilder(boolean multiplicationSign)LinearKindOfQuantity.LinearUnitSelectorcreateUnitSelector(LinearKindOfQuantity kindOfQuantity, Iterable<DecimalPrefix> prefixes)doubledoubleMult()static DecimalPrefixgetEngFloorPrefix(double value)static intgetFloorLog10(double value)static intgetFloorLog1000(double value)static DecimalPrefixgetPrefix(String symbol)Stringidentifier()StringlocalizedName()intpowerOf10()DecimalScaleFactorscaleFactor()Stringsymbol()StringtoString()DecimalScaleFactorvalueFactorTo(DecimalPrefix targetPrefix)static DecimalPrefixvalueOf(String name)Returns the enum constant of this type with the specified name.static DecimalPrefix[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
YOCTO
public static final DecimalPrefix YOCTO
-
ZEPTO
public static final DecimalPrefix ZEPTO
-
ATTO
public static final DecimalPrefix ATTO
-
FEMTO
public static final DecimalPrefix FEMTO
-
PICO
public static final DecimalPrefix PICO
-
NANO
public static final DecimalPrefix NANO
-
MICRO
public static final DecimalPrefix MICRO
-
MILLI
public static final DecimalPrefix MILLI
-
CENTI
public static final DecimalPrefix CENTI
-
DECI
public static final DecimalPrefix DECI
-
NONE
public static final DecimalPrefix NONE
-
DECA
public static final DecimalPrefix DECA
-
HECTO
public static final DecimalPrefix HECTO
-
KILO
public static final DecimalPrefix KILO
-
MEGA
public static final DecimalPrefix MEGA
-
GIGA
public static final DecimalPrefix GIGA
-
TERA
public static final DecimalPrefix TERA
-
PETA
public static final DecimalPrefix PETA
-
EXA
public static final DecimalPrefix EXA
-
ZETTA
public static final DecimalPrefix ZETTA
-
YOTTA
public static final DecimalPrefix YOTTA
-
-
Method Detail
-
values
public static DecimalPrefix[] 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 (DecimalPrefix c : DecimalPrefix.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DecimalPrefix valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getPrefix
public static DecimalPrefix getPrefix(String symbol)
-
getFloorLog10
public static int getFloorLog10(double value)
-
getFloorLog1000
public static int getFloorLog1000(double value)
-
getEngFloorPrefix
public static DecimalPrefix getEngFloorPrefix(double value)
-
powerOf10
public int powerOf10()
-
scaleFactor
public DecimalScaleFactor scaleFactor()
- Specified by:
scaleFactorin interfaceIPrefix<DecimalPrefix>
-
valueFactorTo
public DecimalScaleFactor valueFactorTo(DecimalPrefix targetPrefix)
- Specified by:
valueFactorToin interfaceIPrefix<DecimalPrefix>
-
doubleMult
public double doubleMult()
-
symbol
public final String symbol()
- Specified by:
symbolin interfaceIPrefix<DecimalPrefix>- Returns:
- the symbol normally used to present this prefix in a GUI.
-
altSymbol
public final String altSymbol()
Intended to be used for parsing GUI strings where entering the micron character may be cumbersome.- Specified by:
altSymbolin interfaceIPrefix<DecimalPrefix>- Returns:
- alternative symbol, or
nullif no other representation is available
-
identifier
public final String identifier()
- Specified by:
identifierin interfaceIPrefix<DecimalPrefix>- Returns:
- identifier usable for constructing persistable identifiers for units.
-
localizedName
public String localizedName()
- Specified by:
localizedNamein interfaceIPrefix<DecimalPrefix>
-
asExponentialStringBuilder
public StringBuilder asExponentialStringBuilder(boolean multiplicationSign)
- Specified by:
asExponentialStringBuilderin interfaceIPrefix<DecimalPrefix>
-
toString
public String toString()
- Overrides:
toStringin classEnum<DecimalPrefix>
-
createUnitSelector
public LinearKindOfQuantity.LinearUnitSelector createUnitSelector(LinearKindOfQuantity kindOfQuantity, Iterable<DecimalPrefix> prefixes)
- Specified by:
createUnitSelectorin interfaceIPrefix<DecimalPrefix>
-
-