DataSizeUnit
for correct SI and IEC prefixes.@Deprecated public enum SizeUnit extends Enum<SizeUnit>
Enum Constant and Description |
---|
BYTES
Deprecated.
Bytes.
|
GIGABYTES
Deprecated.
Gigabytes.
|
KILOBYTES
Deprecated.
Kilobytes.
|
MEGABYTES
Deprecated.
Megabytes.
|
TERABYTES
Deprecated.
Terabytes.
|
Modifier and Type | Method and Description |
---|---|
long |
convert(long size,
SizeUnit unit)
Deprecated.
Converts a size of the given unit into the current unit.
|
long |
toBytes(long l)
Deprecated.
Converts the given number of the current units into bytes.
|
DataSizeUnit |
toDataSizeUnit()
Deprecated.
Convert this size unit into a data size unit with correct SI and IEC prefix.
|
long |
toGigabytes(long l)
Deprecated.
Converts the given number of the current units into gigabytes.
|
long |
toKilobytes(long l)
Deprecated.
Converts the given number of the current units into kilobytes.
|
long |
toMegabytes(long l)
Deprecated.
Converts the given number of the current units into megabytes.
|
long |
toTerabytes(long l)
Deprecated.
Converts the given number of the current units into terabytes.
|
static SizeUnit |
valueOf(String name)
Deprecated.
Returns the enum constant of this type with the specified name.
|
static SizeUnit[] |
values()
Deprecated.
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 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 size, SizeUnit unit)
size
- the magnitude of the sizeunit
- the unit of the sizepublic long toBytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in bytespublic long toKilobytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in kilobytespublic long toMegabytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in megabytespublic long toGigabytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in bytespublic long toTerabytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in terabytespublic DataSizeUnit toDataSizeUnit()
DataSizeUnit
corresponding to this size unitDataSizeUnit
Copyright © 2020. All rights reserved.