com.jogamp.gluegen.cgram.types

## Class ArrayType

- java.lang.Object
- - com.jogamp.gluegen.cgram.types.Type
  - - com.jogamp.gluegen.cgram.types.MemoryLayoutType
    - - com.jogamp.gluegen.cgram.types.ArrayType

- All Implemented Interfaces:
    Cloneable

      public class ArrayType
      extends MemoryLayoutType
      implements Cloneable

  Represents an array type. This differs from a pointer type in C syntax by the use of "[]" rather than "*". The length may or may not be known; if the length is unknown then a negative number should be passed in to the constructor.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ArrayType(Type elementType, SizeThunk sizeInBytes, int length, int cvAttributes)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ArrayType` | `asArray()` Casts this to an ArrayType or returns null if not an ArrayType.
    `boolean` | `equals(Object arg)` Equality test for Types.
    `Type` | `getBaseElementType()` Helper method to returns the bottom-most element type of this type.
    `Type` | `getElementType()`
    `int` | `getLength()`
    `String` | `getName(boolean includeCVAttrs)` Returns the name of this type, optionally including const/volatile attributes.
    `boolean` | `hasLength()`
    `String` | `toString()` Returns a string representation of this type.
    `String` | `toString(String variableName)`
    `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.MemoryLayoutType

      `isLayouted, setLayouted`

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

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

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

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

- - ### Constructor Detail

    - #### ArrayType

          public ArrayType(Type elementType,
                   SizeThunk sizeInBytes,
                   int length,
                   int cvAttributes)

  - ### Method Detail

    - #### equals

          public boolean equals(Object arg)

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

    - #### getName

          public String getName(boolean includeCVAttrs)

      Description copied from class: `Type`
      Returns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier.
      Overrides:
        `getName` in class `Type`

    - #### asArray

          public ArrayType asArray()

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

    - #### getElementType

          public Type getElementType()

    - #### getLength

          public int getLength()

    - #### hasLength

          public boolean hasLength()

    - #### getBaseElementType

          public Type getBaseElementType()

      Description copied from class: `Type`
      Helper method to returns the bottom-most element type of this type.

      If this is a multidimensional array or pointer method returns the bottom-most element type, otherwise this.

      Overrides:
        `getBaseElementType` in class `Type`

    - #### toString

          public String toString()

      Description copied from class: `Type`
      Returns a string representation of this type. This string is not necessarily suitable for use as a type specifier; for example, it will contain an expanded description of structs/unions.
      Overrides:
        `toString` in class `Type`

    - #### toString

          public String toString(String variableName)

    - #### 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`