com.jogamp.gluegen.cgram.types

## Class EnumType

- java.lang.Object
- - com.jogamp.gluegen.cgram.types.Type
  - - com.jogamp.gluegen.cgram.types.PrimitiveType
    - - com.jogamp.gluegen.cgram.types.IntType
      - - com.jogamp.gluegen.cgram.types.EnumType

- All Implemented Interfaces:
    Cloneable

      public class EnumType
      extends IntType
      implements Cloneable

  Describes enumerated types. Enumerations are like ints except that they have a set of named values.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `EnumType(String name)`
    `protected` | `EnumType(String name, IntType underlyingType, int cvAttributes)`
    `` | `EnumType(String name, SizeThunk enumSizeInBytes)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEnum(String name, long val)`
    `EnumType` | `asEnum()` Casts this to an EnumType or returns null if not an EnumType.
    `Object` | `clone()`
    `boolean` | `containsEnumerate(String name)` Does this enum type contain an enumerate with the given name?
    `boolean` | `equals(Object arg)` Equality test for Types.
    `String` | `getEnumName(int i)` Fetch ith (0..getNumEnumerates() - 1) name
    `long` | `getEnumValue(int i)` Fetch ith (0..getNumEnumerates() - 1) value
    `long` | `getEnumValue(String name)` Fetch the value of the enumerate with the given name.
    `int` | `getNumEnumerates()` Number of enumerates defined in this enum.
    `boolean` | `removeEnumerate(String name)` Remove the enumerate with the given name.
    `void` | `visit(TypeVisitor arg)` Visit this type and all of the component types of this one; for example, the return type and argument types of a FunctionType.

    - ### Methods inherited from class com.jogamp.gluegen.cgram.types.IntType

      `asInt, isPrimitiveUnsigned, isUnsigned, setName, toString`

    - ### Methods inherited from class com.jogamp.gluegen.cgram.types.PrimitiveType

      `isPrimitive`

    - ### Methods inherited from class com.jogamp.gluegen.cgram.types.Type

      `arrayDimension, asArray, asBit, asCompound, asDouble, asFloat, asFunction, asPointer, asVoid, getBaseElementType, getCVAttributes, getCVAttributesString, getCVVariant, getDebugString, getName, getName, getSize, getSize, hashCode, hasTypedefName, isArray, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isVoid, isVolatile, pointerDepth`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EnumType

          public EnumType(String name)

    - #### EnumType

          public EnumType(String name,
                  SizeThunk enumSizeInBytes)

    - #### EnumType

          protected EnumType(String name,
                  IntType underlyingType,
                  int cvAttributes)

  - ### Method Detail

    - #### clone

          public Object clone()

      Overrides:
        `clone` in class `Type`

    - #### equals

          public boolean equals(Object arg)

      Description copied from class: `Type`
      Equality test for Types.
      Overrides:
        `equals` in class `IntType`

    - #### asEnum

          public EnumType asEnum()

      Description copied from class: `Type`
      Casts this to an EnumType or returns null if not an EnumType.
      Overrides:
        `asEnum` in class `Type`

    - #### addEnum

          public void addEnum(String name,
                     long val)

    - #### getNumEnumerates

          public int getNumEnumerates()

      Number of enumerates defined in this enum.

    - #### getEnumName

          public String getEnumName(int i)

      Fetch ith (0..getNumEnumerates() - 1) name

    - #### getEnumValue

          public long getEnumValue(int i)

      Fetch ith (0..getNumEnumerates() - 1) value

    - #### getEnumValue

          public long getEnumValue(String name)

      Fetch the value of the enumerate with the given name.

    - #### containsEnumerate

          public boolean containsEnumerate(String name)

      Does this enum type contain an enumerate with the given name?

    - #### removeEnumerate

          public boolean removeEnumerate(String name)

      Remove the enumerate with the given name. Returns true if it was found and removed; false if it was not found.

    - #### visit

          public void visit(TypeVisitor arg)

      Description copied from class: `Type`
      Visit this type and all of the component types of this one; for example, the return type and argument types of a FunctionType.
      Overrides:
        `visit` in class `Type`