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 String
altSymbol()
Intended to be used for parsing GUI strings where entering the micron character may be cumbersome.StringBuilder
asExponentialStringBuilder(boolean multiplicationSign)
LinearKindOfQuantity.LinearUnitSelector
createUnitSelector(LinearKindOfQuantity kindOfQuantity, Iterable<DecimalPrefix> prefixes)
double
doubleMult()
static DecimalPrefix
getEngFloorPrefix(double value)
static int
getFloorLog10(double value)
static int
getFloorLog1000(double value)
static DecimalPrefix
getPrefix(String symbol)
String
identifier()
String
localizedName()
int
powerOf10()
DecimalScaleFactor
scaleFactor()
String
symbol()
String
toString()
DecimalScaleFactor
valueFactorTo(DecimalPrefix targetPrefix)
static DecimalPrefix
valueOf(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:
scaleFactor
in interfaceIPrefix<DecimalPrefix>
-
valueFactorTo
public DecimalScaleFactor valueFactorTo(DecimalPrefix targetPrefix)
- Specified by:
valueFactorTo
in interfaceIPrefix<DecimalPrefix>
-
doubleMult
public double doubleMult()
-
symbol
public final String symbol()
- Specified by:
symbol
in 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:
altSymbol
in interfaceIPrefix<DecimalPrefix>
- Returns:
- alternative symbol, or
null
if no other representation is available
-
identifier
public final String identifier()
- Specified by:
identifier
in interfaceIPrefix<DecimalPrefix>
- Returns:
- identifier usable for constructing persistable identifiers for units.
-
localizedName
public String localizedName()
- Specified by:
localizedName
in interfaceIPrefix<DecimalPrefix>
-
asExponentialStringBuilder
public StringBuilder asExponentialStringBuilder(boolean multiplicationSign)
- Specified by:
asExponentialStringBuilder
in interfaceIPrefix<DecimalPrefix>
-
toString
public String toString()
- Overrides:
toString
in classEnum<DecimalPrefix>
-
createUnitSelector
public LinearKindOfQuantity.LinearUnitSelector createUnitSelector(LinearKindOfQuantity kindOfQuantity, Iterable<DecimalPrefix> prefixes)
- Specified by:
createUnitSelector
in interfaceIPrefix<DecimalPrefix>
-
-