Enum 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 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 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.