Package ucar.nc2

Class EnumTypedef


  • @Immutable
    public class EnumTypedef
    extends ucar.nc2.CDMNode
    A named map from integers to Strings; a user-defined Enum used as a Variable's data type. For ENUM1, ENUM2, ENUM4 enumeration types. Immutable. TODO EnumTypedef will not extend CDMNode in 6. TODO EnumTypedef will not have a reference to its owning Group in 6. TODO EnumTypedef.getFullName() will not exist in 6.
    • Constructor Detail

      • EnumTypedef

        public EnumTypedef​(String name,
                           Map<Integer,​String> map)
        Make an EnumTypedef with base type ENUM4.
      • EnumTypedef

        public EnumTypedef​(String name,
                           Map<Integer,​String> map,
                           DataType basetype)
        Make an EnumTypedef setting the base type (must be ENUM1, ENUM2, ENUM4).
    • Method Detail

      • getMap

        public com.google.common.collect.ImmutableMap<Integer,​String> getMap()
      • getBaseType

        public DataType getBaseType()
        One of DataType.ENUM1, DataType.ENUM2, or DataType.ENUM4.
      • lookupEnumString

        @Nullable
        public String lookupEnumString​(int e)
        Get the name corresponding to the enum value.
      • lookupEnumInt

        @Nullable
        public Integer lookupEnumInt​(String name)
        Get the enum value corresponding to the name.
      • equalsMapOnly

        public boolean equalsMapOnly​(Object o)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object