Class Enum

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Enum​(int value)
      Overloaded.
      protected Enum​(int value, String name)
      Overloaded.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object o)
      Indicates whether some other object is equal to this one.
      int getIntValue()
      Returns the integer value of this enum.
      boolean greater​(Enum en)
      Indicates whether the integer value of this Enum is greater than the integer value of some other Enum.
      boolean greaterEqual​(Enum en)
      Indicates whether the integer value of this Enum is greater than or equal to the integer value of some other Enum.
      boolean less​(Enum en)
      Indicates whether the integer value of this Enum is less than the integer value of some other Enum.
      boolean lessEqual​(Enum en)
      Indicates whether the integer value of this Enum is less than or equal to the integer value of some other Enum.
      String toString()
      Overridden.
    • Constructor Detail

      • Enum

        protected Enum​(int value)
        Overloaded. Creates and initializes an Enum instance without a name.
        Parameters:
        value - The integer value of the resulting Enum.
      • Enum

        protected Enum​(int value,
                       String name)
        Overloaded. Creates and initializes an Enum instance with a name.
        Parameters:
        value - The integer value of the resulting Enum
        name - Specifies the name of this instance. Describes this Enum object
    • Method Detail

      • toString

        public String toString()
        Overridden. Creates and returns a string representation of this object.
        Overrides:
        toString in class Object
        Returns:
        A string representation of this object. The return value is either the name of this Enum object if set or the integer value converted to a string.
      • getIntValue

        public int getIntValue()
        Returns the integer value of this enum.
        Returns:
        The integer value of this enum. For a string representation of this Enum object, refer to the documentation of the toString method.
      • equals

        public boolean equals​(Object o)
        Indicates whether some other object is equal to this one.

        This method returns true if the supplied Object is an Enum and has the same integer value as returned by the getIntValue() method of this object. If the supplied Object is not an Enum, this method calls the equals method of the parent class.

        Overrides:
        equals in class Object
        Parameters:
        o - The object to compare this enum with.
        Returns:
        True if the supplied object equals this enum and false otherwise.
      • less

        public boolean less​(Enum en)
        Indicates whether the integer value of this Enum is less than the integer value of some other Enum.
        Parameters:
        en - The enum to compare this enum with.
        Returns:
        True if the integer value of this Enum is less than the integer value of the supplied Enum and false otherwise.
      • lessEqual

        public boolean lessEqual​(Enum en)
        Indicates whether the integer value of this Enum is less than or equal to the integer value of some other Enum.
        Parameters:
        en - The enum to compare this enum with.
        Returns:
        True if the integer value of this Enum is less than or equal to the integer value of the supplied Enum and false otherwise.
      • greater

        public boolean greater​(Enum en)
        Indicates whether the integer value of this Enum is greater than the integer value of some other Enum.
        Parameters:
        en - The enum to compare this enum with.
        Returns:
        True if the integer value of this Enum is greater than the integer value of the supplied Enum and false otherwise.
      • greaterEqual

        public boolean greaterEqual​(Enum en)
        Indicates whether the integer value of this Enum is greater than or equal to the integer value of some other Enum.
        Parameters:
        en - The enum to compare this enum with.
        Returns:
        True if the integer value of this Enum is greater than or equal to the integer value of the supplied Enum and false otherwise.