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