Enum Class DataUnit
- 所有已实现的接口:
Serializable,Comparable<DataUnit>,Constable
A standard set of
DataSize units.
The unit prefixes used in this class are binary prefixes indicating multiplication by powers of 2. The following table displays the enum constants defined in this class and corresponding values.
| Constant | Data Size | Power of 2 | Size in Bytes |
|---|---|---|---|
BYTES | 1B | 2^0 | 1 |
KILOBYTES | 1KB | 2^10 | 1,024 |
MEGABYTES | 1MB | 2^20 | 1,048,576 |
GIGABYTES | 1GB | 2^30 | 1,073,741,824 |
TERABYTES | 1TB | 2^40 | 1,099,511,627,776 |
- 从以下版本开始:
- 2.1.3
- 作者:
- Stephane Nicoll, TODAY
-
嵌套类概要
从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
枚举常量概要
枚举常量 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static DataUnitfromSuffix(String suffix) Return theDataUnitmatching the specifiedsuffix.(专用程序包) DataSizesize()static DataUnitReturns the enum constant of this class with the specified name.static DataUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
枚举常量详细资料
-
BYTES
Bytes. -
KILOBYTES
Kilobytes. -
MEGABYTES
Megabytes. -
GIGABYTES
Gigabytes. -
TERABYTES
Terabytes.
-
-
字段详细资料
-
suffix
-
size
-
-
构造器详细资料
-
DataUnit
-
-
方法详细资料
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- 返回:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- 如果参数为空值
-
size
DataSize size() -
fromSuffix
Return theDataUnitmatching the specifiedsuffix.- 参数:
suffix- one of the standard suffixes- 返回:
- the
DataUnitmatching the specifiedsuffix - 抛出:
IllegalArgumentException- if the suffix does not match the suffix of any of this enum's constants
-