Package com.yahoo.binaryprefix
Enum BinaryPrefix
- java.lang.Object
-
- java.lang.Enum<BinaryPrefix>
-
- com.yahoo.binaryprefix.BinaryPrefix
-
- All Implemented Interfaces:
Serializable
,Comparable<BinaryPrefix>
public enum BinaryPrefix extends Enum<BinaryPrefix>
Represents binary prefixes.- Author:
- Tony Vaagenes
-
-
Field Summary
Fields Modifier and Type Field Description char
symbol
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
convertFrom(double value, BinaryPrefix binaryPrefix)
static BinaryPrefix
fromSymbol(char c)
static BinaryPrefix
valueOf(String name)
Returns the enum constant of this type with the specified name.static BinaryPrefix[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
unit
public static final BinaryPrefix unit
-
kilo
public static final BinaryPrefix kilo
-
mega
public static final BinaryPrefix mega
-
giga
public static final BinaryPrefix giga
-
tera
public static final BinaryPrefix tera
-
peta
public static final BinaryPrefix peta
-
exa
public static final BinaryPrefix exa
-
zetta
public static final BinaryPrefix zetta
-
yotta
public static final BinaryPrefix yotta
-
-
Method Detail
-
values
public static BinaryPrefix[] 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 (BinaryPrefix c : BinaryPrefix.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BinaryPrefix 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
-
convertFrom
public double convertFrom(double value, BinaryPrefix binaryPrefix)
-
fromSymbol
public static BinaryPrefix fromSymbol(char c)
-
-