public enum MetricUnit extends Enum<MetricUnit>
JedecByteUnit or IecByteUnit instead.| Enum Constant and Description |
|---|
GIGA
1,000,000,000
|
KILO
The metric standard says this should be lower case...
|
MEGA
1,000,000
|
TERA
1,000,000,000,000
|
UNIT
1
|
| Modifier and Type | Method and Description |
|---|---|
double |
convertTo(MetricUnit unit,
double value) |
long |
multiplier() |
static long |
parse(String value) |
String |
suffix() |
long |
toLong(double value) |
long |
toLong(long value) |
String |
toString(double value) |
String |
toString(long value) |
static MetricUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MetricUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MetricUnit UNIT
public static final MetricUnit KILO
public static final MetricUnit MEGA
public static final MetricUnit GIGA
public static final MetricUnit TERA
public static MetricUnit[] values()
for (MetricUnit c : MetricUnit.values()) System.out.println(c);
public static MetricUnit valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant
with the specified nameNullPointerException - if the argument is nullpublic long toLong(long value)
public long toLong(double value)
public String suffix()
public long multiplier()
public String toString(double value)
public String toString(long value)
public double convertTo(MetricUnit unit, double value)
public static long parse(String value)
Copyright © 2012 Last.fm. All Rights Reserved.