Package ucar.nc2

Class EnumTypedef


  • @Immutable
    public class EnumTypedef
    extends Object
    A named map from integers to Strings; a user-defined Enum used as a Variable's data type. For ENUM1, ENUM2, ENUM4 enumeration types.
    • 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,
                           ArrayType basetype)
        Make an EnumTypedef setting the base type (must be ENUM1, ENUM2, ENUM4).
    • Method Detail

      • getBaseArrayType

        public ArrayType getBaseArrayType()
        One of ArrayType.ENUM1, ArrayType.ENUM2, or ArrayType.ENUM4.
      • getShortName

        public String getShortName()
        The EnumTypedef name.
      • getMap

        public com.google.common.collect.ImmutableMap<Integer,​String> getMap()
        The Map from integer to enum name.
      • lookupEnumInt

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

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

        public boolean equalsMapOnly​(Object o)
        Compare only the values in the map. Needed for netCDF4 wierdness.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object