Package ucar.nc2

Class EnumTypedef


  • @Immutable
    public class EnumTypedef
    extends 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

      • getEnumStrings

        @Deprecated
        public com.google.common.collect.ImmutableList<String> getEnumStrings()
        Deprecated.
        use getMap()
      • 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.
      • writeCDL

        @Deprecated
        public String writeCDL​(boolean strict)
        Deprecated.
        use CDLWriter
        CDL string representation.
        Parameters:
        strict - if true, write in strict adherence to CDL definition.
        Returns:
        CDL representation.
      • equalsMapOnly

        public boolean equalsMapOnly​(Object o)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object