com.supermap.data

类 Enum

    • 方法详细资料

      • getNames

        public static final String[] getNames(Class type)
        返回指定枚举类的所有枚举常量的名称的集合。
        参数:
        type - 指定的枚举类。
        返回:
        指定枚举类中枚举常量的名称的集合。
      • getValues

        public static int[] getValues(Class type)
        返回指定枚举类的枚举值的集合。
        参数:
        type - 指定的枚举类。
        返回:
        指定枚举类的枚举值的集合。
      • getPredefineValues

        public static int[] getPredefineValues(Class type)
        返回 SuperMap iObjects Java 已定的枚举类的枚举值。
        参数:
        type - 指定的枚举类。
        返回:
        返回 SuperMap iObjects Java 已定的枚举类的枚举值。
      • getEnums

        public static Enum[] getEnums(Class type)
        返回指定枚举类的所有枚举常量。
        参数:
        type - 指定的枚举类。
        返回:
        指定枚举类的所有枚举常量。
      • getNameByValue

        public static String getNameByValue(Class type,
                                            int value)
        根据枚举值返回对应的枚举常量的名称。
        参数:
        type - 指定的枚举类。
        value - 指定的枚举值。
        返回:
        枚举常量的名称。
      • getValueByName

        public static int getValueByName(Class type,
                                         String name)
        根据枚举常量的名称返回对应的枚举值。
        参数:
        type - 指定的枚举类。
        name - 指定的枚举常量的名称。
        返回:
        枚举值。
      • parse

        public static Enum parse(Class type,
                                 int value)
        根据枚举值返回对应的枚举常量。
        参数:
        type - 指定的枚举类。
        value - 指定的枚举值。
        返回:
        对应的枚举常量。
      • parse

        public static Enum parse(Class type,
                                 String name)
        根据枚举常量的名称返回对应的枚举常量。
        参数:
        type - 指定的枚举类。
        name - 指定的枚举常量的名称。
        返回:
        枚举常量。
      • isDefined

        public static boolean isDefined(Class type,
                                        int value)
        枚举类型中是否定义了指定的枚举值对应的枚举常量。
        参数:
        type - 指定的枚举类。
        value - 指定的枚举值。
        返回:
        一个布尔值,true 表示已定义,false 表示未定义。
      • isDefined

        public static boolean isDefined(Class type,
                                        String name)
        枚举类型中是否定义了指定的枚举名的枚举常量。
        参数:
        type - Class 指定的枚举类。
        name - String 指定的枚举名。
        返回:
        一个布尔值,true 表示已定义,false 表示未定义。
      • name

        public final String name()
        返回枚举常量的名称。
        返回:
        枚举常量的名称。
      • value

        public final int value()
        返回枚举值。
        返回:
        枚举值。
      • toString

        public String toString()
        返回枚举常量的名称。
        覆盖:
        toString 在类中 Object
        返回:
        枚举常量的名称。
      • equals

        public final boolean equals(Object other)
        当指定对象等于此枚举常量时,返回 true。

        由于枚举值表现为静态的字段,因此直接比较引用便可知两枚举是否相等。

        覆盖:
        equals 在类中 Object
        参数:
        other - 要与此对象进行相等性比较的对象。
        返回:
        一个布尔值,如果指定对象等于此枚举常量,则返回 true。
      • hashCode

        public final int hashCode()
        返回枚举常量的哈希码。
        覆盖:
        hashCode 在类中 Object
        返回:
        枚举常量的哈希码。

Copyright © 2021–2024 SuperMap. All rights reserved.