Package org.eclipse.mat.query
Enum BytesDisplay
- java.lang.Object
-
- java.lang.Enum<BytesDisplay>
-
- org.eclipse.mat.query.BytesDisplay
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<BytesDisplay>
public enum BytesDisplay extends java.lang.Enum<BytesDisplay>
This enumeration specifies how to display a number of bytes. It can be configured using -Dbytes_display=(bytes|kilobytes|megabytes|gigabytes|smart) or through the Eclipse preferences dialog.- Since:
- 1.5
-
-
Enum Constant Summary
Enum Constants Enum Constant 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.
-
Field Summary
Fields Modifier and Type Field Description static BytesDisplay
DEFAULT
Default bytes display format.static java.lang.String
PROPERTY_NAME
System property name to specify a bytes display.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BytesDisplay
getCurrentValue()
Return the currently selected preference from the system properties.static BytesDisplay
parse(java.lang.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(java.lang.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.
-
-
-
Enum Constant Detail
-
Bytes
public static final BytesDisplay Bytes
Units of bytes (8 bits).
-
Kilobytes
public static final BytesDisplay Kilobytes
Units of kilobytes (1,024 bytes).
-
Megabytes
public static final BytesDisplay Megabytes
Units of megabytes (1,048,576 bytes).
-
Gigabytes
public static final BytesDisplay Gigabytes
Units of gigabytes (1,073,741,824 bytes).
-
Smart
public static final BytesDisplay Smart
If the value is a gigabyte or more, display in gigabytes; similarly for megabytes and kilobytes; otherwise, display in bytes.
-
-
Field Detail
-
DEFAULT
public static final BytesDisplay DEFAULT
Default bytes display format.
-
PROPERTY_NAME
public static final java.lang.String PROPERTY_NAME
System property name to specify a bytes display.- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static BytesDisplay[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BytesDisplay c : BytesDisplay.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BytesDisplay valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
parse
public static BytesDisplay parse(java.lang.String value)
Given a stored preference value, return the enumeration value, or otherwise the default.- Parameters:
value
- The preference value.- Returns:
- Given a stored preference value, return the enumeration value, or otherwise the default.
-
getCurrentValue
public static BytesDisplay getCurrentValue()
Return the currently selected preference from the system properties.- Returns:
- Current preference or reflection of command line setting.
-
setCurrentValue
public static void setCurrentValue(BytesDisplay val)
Uses system properties to set the current value.- Parameters:
val
- The new value.
-
-