public enum SizeUnit extends Enum<SizeUnit>
SizeUnit represents digital information size at a given
unit of granularity and provides utility methods to convert across
the units.| Enum Constant and Description |
|---|
BYTES |
GIGABYTES |
KILOBYTES |
MEGABYTES |
PETABYTES |
TERABYTES |
| Modifier and Type | Method and Description |
|---|---|
long |
convert(long source,
SizeUnit sourceUnit) |
long |
toBytes(long value) |
long |
toGigabytes(long value) |
long |
toKilobytes(long value) |
long |
toMegabytes(long value) |
long |
toPetabytes(long value) |
long |
toTerabytes(long value) |
static SizeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SizeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SizeUnit BYTES
public static final SizeUnit KILOBYTES
public static final SizeUnit MEGABYTES
public static final SizeUnit GIGABYTES
public static final SizeUnit TERABYTES
public static final SizeUnit PETABYTES
public static SizeUnit[] values()
for (SizeUnit c : SizeUnit.values()) System.out.println(c);
public static SizeUnit 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 convert(long source,
SizeUnit sourceUnit)
public long toBytes(long value)
public long toKilobytes(long value)
public long toMegabytes(long value)
public long toGigabytes(long value)
public long toTerabytes(long value)
public long toPetabytes(long value)
Copyright © 2019 Appulse. All rights reserved.