public enum Data extends Enum<Data> implements Unit<Data>
Amount
s.
The kilo/mega/giga/... hierarchy is built on base 2 so that the hierarchy increases by a factor
of 1024 instead of 1000 as typical in metric units. Additionally, units are divided in 2
hierarchies one based on bits and the other on bytes. Thus Kb
represents kilobits; so
1 Kb = 1024 bits, and KB
represents kilobytes so 1 KB = 1024 bytes or 8192 bits.Enum Constant and Description |
---|
BITS |
BYTES |
Gb |
GB |
Kb |
KB |
Mb |
MB |
PB |
TB |
Modifier and Type | Method and Description |
---|---|
double |
multiplier()
Returns the weight of this unit relative to other units in the same hierarchy.
|
static Data |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Data[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Data BITS
public static final Data Kb
public static final Data Mb
public static final Data Gb
public static final Data BYTES
public static final Data KB
public static final Data MB
public static final Data GB
public static final Data TB
public static final Data PB
public static Data[] values()
for (Data c : Data.values()) System.out.println(c);
public static Data 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 double multiplier()
Unit
multiplier
in interface Unit<Data>
Copyright © 2017 Perforce Software. All Rights Reserved.