public enum BytesDisplay extends Enum<BytesDisplay>
Enum Constant and Description |
---|
Bytes
Units of bytes (8 bits).
|
Gigabytes
Units of gigabytes (1,073,741,824 bytes).
|
Kilobytes
Units of kilobytes (1,024 bytes).
|
Megabytes
Units of megabytes (1,048,576 bytes).
|
Smart
If the value is a gigabyte or more, display in gigabytes; similarly for
megabytes and kilobytes; otherwise, display in bytes.
|
Modifier and Type | Field and Description |
---|---|
static BytesDisplay |
DEFAULT
Default bytes display format.
|
static String |
PROPERTY_NAME
System property name to specify a bytes display.
|
Modifier and Type | Method and Description |
---|---|
static BytesDisplay |
getCurrentValue()
Return the currently selected preference from the system properties.
|
static BytesDisplay |
parse(String value)
Given a stored preference value, return the enumeration value, or
otherwise the default.
|
static void |
setCurrentValue(BytesDisplay val)
Uses system properties to set the current value.
|
static BytesDisplay |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BytesDisplay[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BytesDisplay Bytes
public static final BytesDisplay Kilobytes
public static final BytesDisplay Megabytes
public static final BytesDisplay Gigabytes
public static final BytesDisplay Smart
public static final BytesDisplay DEFAULT
public static final String PROPERTY_NAME
public static BytesDisplay[] values()
for (BytesDisplay c : BytesDisplay.values()) System.out.println(c);
public static BytesDisplay 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 static BytesDisplay parse(String value)
value
- The preference value.public static BytesDisplay getCurrentValue()
public static void setCurrentValue(BytesDisplay val)
val
- The new value.