org.eclipse.mat.query

## Enum BytesDisplay

- java.lang.Object
- - java.lang.Enum<BytesDisplay>
  - - org.eclipse.mat.query.BytesDisplay

All Implemented Interfaces:
  Serializable, Comparable<BytesDisplay>

    public enum BytesDisplay
    extends 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 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` Unites 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
`static BytesDisplay` `DEFAULT` Default bytes display format.
`static String` `PROPERTY_NAME` System property name to specify a bytes display.

### Method Summary

All Methods Static Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Enum

`compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### 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

Unites 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 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(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:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### parse

    public static BytesDisplay parse(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.