- All Implemented Interfaces:
IValueObject
,Serializable
,Comparable<SIPrefixes>
,Constable
SI prefixes.
https://en.wikipedia.org/wiki/Metric_prefix
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAtto.Centi.Deca.Deci.Exa.Femto.Giga.Hecto.Kilo.Mega.Micro.Milli.Nano.Peta.Pico.Quecto.Quetta.Ronna.Ronto.Tera.Yocto.Yotta.Zepto.Zero.Zetta. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Base 10 number.private static final NavigableSet<SIPrefixes>
Ordered enum constants.private final String
Symbol. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SIPrefixes
base()
Get base (0) prefix.static SIPrefixes
byBase
(int base) Get SIPrefixes by base.static SIPrefixes
first()
Get first (lowest) prefix.int
getBase()
Get base number.getName()
Get prefix name.Get prefix symbol.boolean
hasNext()
Has next.boolean
Has previous.static SIPrefixes
last()
Get last (highest) prefix.next()
Get next prefix.previous()
Get previous prefix.Returns the value of this SIPrefixes as a string.static SIPrefixes
Returns the enum constant of this class with the specified name.static SIPrefixes[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
QUECTO
Quecto. -
RONTO
Ronto. -
YOCTO
Yocto. -
ZEPTO
Zepto. -
ATTO
Atto. -
FEMTO
Femto. -
PICO
Pico. -
NANO
Nano. -
MICRO
Micro. -
MILLI
Milli. -
CENTI
Centi. -
DECI
Deci. -
ZERO
Zero. -
DECA
Deca. -
HECTO
Hecto. -
KILO
Kilo. -
MEGA
Mega. -
GIGA
Giga. -
TERA
Tera. -
PETA
Peta. -
EXA
Exa. -
ZETTA
Zetta. -
YOTTA
Yotta. -
RONNA
Ronna. -
QUETTA
Quetta.
-
-
Field Details
-
ORDERED_ENUM_CONSTANTS
Ordered enum constants. -
base
private final int baseBase 10 number. -
symbol
Symbol.
-
-
Constructor Details
-
SIPrefixes
Constructor.- Parameters:
base
- Base 10 numbersymbol
- Symbol
-
-
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
-
first
Get first (lowest) prefix.- Returns:
- first (lowest) prefix
-
last
Get last (highest) prefix.- Returns:
- last (highest) prefix
-
base
Get base (0) prefix.- Returns:
- Base (0) prefix
-
byBase
Get SIPrefixes by base.- Parameters:
base
- Base 10- Returns:
- SIPrefixes
- Throws:
NoSuchElementException
- If there is no prefix with the given base
-
getBase
public int getBase()Get base number.- Returns:
- Base number
-
hasNext
public boolean hasNext()Has next.- Returns:
- true: if there is a higher value; false otherwise
-
hasPrevious
public boolean hasPrevious()Has previous.- Returns:
- true: if there is a lower value; false otherwise
-
next
Get next prefix.- Returns:
- Next higher prefix
- Throws:
NoSuchElementException
- If there is no higher prefix
-
previous
Get previous prefix.- Returns:
- Previous lower prefix
- Throws:
NoSuchElementException
- If there is no lower prefix
-
getName
Get prefix name.- Returns:
- Prefix name
-
getSymbol
Get prefix symbol.- Returns:
- Prefix symbol
-
stringValue
Returns the value of this SIPrefixes as a string.- Specified by:
stringValue
in interfaceIValueObject
- Returns:
- The text value represented by this object after conversion to type string.
-