Package org.openjdk.jmc.common.unit
Enum Class DecimalPrefix
- All Implemented Interfaces:
Serializable,Comparable<DecimalPrefix>,Constable,IPrefix<DecimalPrefix>
Decimal prefixes, as standardized by SI. Extend functionality as needed, perhaps like
TimeUnit.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionfinal StringIntended to be used for parsing GUI strings where entering the micron character may be cumbersome.asExponentialStringBuilder(boolean multiplicationSign) createUnitSelector(LinearKindOfQuantity kindOfQuantity, Iterable<DecimalPrefix> prefixes) doublestatic DecimalPrefixgetEngFloorPrefix(double value) static intgetFloorLog10(double value) static intgetFloorLog1000(double value) static DecimalPrefixfinal Stringintfinal Stringsymbol()toString()valueFactorTo(DecimalPrefix targetPrefix) static DecimalPrefixReturns the enum constant of this class with the specified name.static DecimalPrefix[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
QUECTO
-
RONTO
-
YOCTO
-
ZEPTO
-
ATTO
-
FEMTO
-
PICO
-
NANO
-
MICRO
-
MILLI
-
CENTI
-
DECI
-
NONE
-
DECA
-
HECTO
-
KILO
-
MEGA
-
GIGA
-
TERA
-
PETA
-
EXA
-
ZETTA
-
YOTTA
-
RONNA
-
QUETTA
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getPrefix
-
getFloorLog10
public static int getFloorLog10(double value) -
getFloorLog1000
public static int getFloorLog1000(double value) -
getEngFloorPrefix
-
powerOf10
public int powerOf10() -
scaleFactor
- Specified by:
scaleFactorin interfaceIPrefix<DecimalPrefix>
-
valueFactorTo
- Specified by:
valueFactorToin interfaceIPrefix<DecimalPrefix>
-
doubleMult
public double doubleMult() -
symbol
- Specified by:
symbolin interfaceIPrefix<DecimalPrefix>- Returns:
- the symbol normally used to present this prefix in a GUI.
-
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
- Specified by:
identifierin interfaceIPrefix<DecimalPrefix>- Returns:
- identifier usable for constructing persistable identifiers for units.
-
localizedName
- Specified by:
localizedNamein interfaceIPrefix<DecimalPrefix>
-
asExponentialStringBuilder
- Specified by:
asExponentialStringBuilderin interfaceIPrefix<DecimalPrefix>
-
toString
- Overrides:
toStringin classEnum<DecimalPrefix>
-
createUnitSelector
public LinearKindOfQuantity.LinearUnitSelector createUnitSelector(LinearKindOfQuantity kindOfQuantity, Iterable<DecimalPrefix> prefixes) - Specified by:
createUnitSelectorin interfaceIPrefix<DecimalPrefix>
-