Package ucar.nc2

Class EnumTypedef

java.lang.Object
ucar.nc2.CDMNode
ucar.nc2.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 Details

    • 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 Details

    • 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.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • equalsMapOnly

      public boolean equalsMapOnly(Object o)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object