com.supermap.data

Class Enum

  • java.lang.Object
    • com.supermap.data.Enum
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object other)
      Returns true if the specified object equals to this enumeration constant.
      static Enum[] getEnums(java.lang.Class type)
      Returns all the enumeration constants in the given enumeration class.
      static java.lang.String getNameByValue(java.lang.Class type, int value)
      Returns the name of the corresponding enumeration constant based on the enumeration value.
      static java.lang.String[] getNames(java.lang.Class type)
      Returns the name collection of all the enumeration constants in specific enumeration class.
      static int getValueByName(java.lang.Class type, java.lang.String name)
      Returns the enumeration value based on the enumeration constant name.
      static int[] getValues(java.lang.Class type)
      Returns the enumeration value collection in the given enumeration class.
      int hashCode()
      Returns the hash code of the enumeration constant.
      static boolean isDefined(java.lang.Class type, int value)
      Whether the enumeration type defined the enumeration constant corresponding to the given enumeration value.
      static boolean isDefined(java.lang.Class type, java.lang.String name)
      Whether the enumeration type defined the enumeration constant with the given enumeration name.
      java.lang.String name()
      Returns the name of the enumeration constant.
      static Enum parse(java.lang.Class type, int value)
      Returns the enumeration constant based on the corresponding enumeration value.
      static Enum parse(java.lang.Class type, java.lang.String name)
      Returns the enumeration based on the enumeration constant name.
      java.lang.String toString()
      Returns the name of the enumeration constant.
      int value()
      Returns the enumeration value.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • name

        public final java.lang.String name()
        Returns the name of the enumeration constant.
        Returns:
        the name of the enumeration constant.
      • value

        public final int value()
        Returns the enumeration value.
        Returns:
        the enumeration value.
      • toString

        public java.lang.String toString()
        Returns the name of the enumeration constant.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the name of the enumeration constant.
      • equals

        public final boolean equals(java.lang.Object other)
        Returns true if the specified object equals to this enumeration constant.

        Since the enumeration value is a static field, you can know whether the two enumerations are equal by comparing the reference.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - the object used to compare.
        Returns:
        a boolean, return true if the specified object equals to this enumeration constant.
      • hashCode

        public final int hashCode()
        Returns the hash code of the enumeration constant.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The has code of the enumeration constant.
      • getNames

        public static final java.lang.String[] getNames(java.lang.Class type)
        Returns the name collection of all the enumeration constants in specific enumeration class.
        Parameters:
        type - the given enumeration class.
        Returns:
        the name collection of the enumeration constants in specific enumeration class.
      • getValues

        public static int[] getValues(java.lang.Class type)
        Returns the enumeration value collection in the given enumeration class.
        Parameters:
        type - the given enumeration class.
        Returns:
        the enumeration value collection in the given enumeration class.
      • getEnums

        public static Enum[] getEnums(java.lang.Class type)
        Returns all the enumeration constants in the given enumeration class.
        Parameters:
        type - the given enumeration class.
        Returns:
        all the enumeration constants in the given enumeration class.
      • getNameByValue

        public static java.lang.String getNameByValue(java.lang.Class type,
                                                      int value)
        Returns the name of the corresponding enumeration constant based on the enumeration value.
        Parameters:
        type - the given enumeration class.
        value - the specified enumeration value.
        Returns:
        the name of the enumeration constant.
      • getValueByName

        public static int getValueByName(java.lang.Class type,
                                         java.lang.String name)
        Returns the enumeration value based on the enumeration constant name.
        Parameters:
        type - the given enumeration class.
        name - the name of the specified enumeration constant.
        Returns:
        the enumeration value.
      • parse

        public static Enum parse(java.lang.Class type,
                                 int value)
        Returns the enumeration constant based on the corresponding enumeration value.
        Parameters:
        type - the given enumeration class.
        value - the specified enumeration value.
        Returns:
        The corresponding enumeration constant
      • parse

        public static Enum parse(java.lang.Class type,
                                 java.lang.String name)
        Returns the enumeration based on the enumeration constant name.
        Parameters:
        type - the given enumeration class.
        name - the name of the specified enumeration constant.
        Returns:
        the enumeration constant.
      • isDefined

        public static boolean isDefined(java.lang.Class type,
                                        int value)
        Whether the enumeration type defined the enumeration constant corresponding to the given enumeration value.
        Parameters:
        type - the given enumeration class.
        value - the specified enumeration value.
        Returns:
        a boolean, true means defined; Otherwise returns false.
      • isDefined

        public static boolean isDefined(java.lang.Class type,
                                        java.lang.String name)
        Whether the enumeration type defined the enumeration constant with the given enumeration name.
        Parameters:
        type - class the given enumeration class.
        name - String the given enumeration name.
        Returns:
        a boolean, true means defined; Otherwise returns false.