Class ArrayType

  • All Implemented Interfaces:
    java.lang.Cloneable, Constants, Constants, ContextElement, Constants, RuntimeConstants

    public class ArrayType
    extends Type
    ArrayType is a wrapper for any of the other types. The getElementType() method can be used to get the array element type. The getArrayDimension() method can be used to get the array dimension.
    • Field Detail

      • type

        private Type type
      • arrayDimension

        private int arrayDimension
      • brackets

        private java.lang.String brackets
      • bracketsSig

        private java.lang.String bracketsSig
    • Constructor Detail

      • ArrayType

        private ArrayType​(ContextStack stack,
                          Type type,
                          int arrayDimension)
        Create an ArrayType instance for the given type. The resulting object is not yet completely initialized.
    • Method Detail

      • forArray

        public static ArrayType forArray​(Type theType,
                                         ContextStack stack)
        Create an ArrayType object for the given type. If the class is not a properly formed or if some other error occurs, the return value will be null, and errors will have been reported to the supplied BatchEnvironment.
      • getSignature

        public java.lang.String getSignature()
        Return signature for this type (e.g. com.acme.Dynamite would return "com.acme.Dynamite", byte = "B")
        Specified by:
        getSignature in class Type
      • getElementType

        public Type getElementType()
        Get element type. Returns null if not an array.
        Overrides:
        getElementType in class Type
      • getArrayDimension

        public int getArrayDimension()
        Get array dimension. Returns zero if not an array.
        Overrides:
        getArrayDimension in class Type
      • getArrayBrackets

        public java.lang.String getArrayBrackets()
        Get brackets string. Returns "" if not an array.
        Overrides:
        getArrayBrackets in class Type
      • toString

        public java.lang.String toString()
        Return a string representation of this type.
        Overrides:
        toString in class Type
      • getTypeDescription

        public java.lang.String getTypeDescription()
        Return a string describing this type.
        Specified by:
        getTypeDescription in class Type
      • getTypeName

        public java.lang.String getTypeName​(boolean useQualifiedNames,
                                            boolean useIDLNames,
                                            boolean globalIDLNames)
        Return the name of this type. For arrays, will include "[]" if useIDLNames == false.
        Overrides:
        getTypeName in class Type
        Parameters:
        useQualifiedNames - If true, print qualified names; otherwise, print unqualified names.
        useIDLNames - If true, print IDL names; otherwise, print java names.
        globalIDLNames - If true and useIDLNames true, prepends "::".
      • swapInvalidTypes

        protected void swapInvalidTypes()
        Convert all invalid types to valid ones.
        Overrides:
        swapInvalidTypes in class Type
      • addTypes

        protected boolean addTypes​(int typeCodeFilter,
                                   java.util.HashSet checked,
                                   java.util.Vector matching)
        Overrides:
        addTypes in class Type
      • loadClass

        protected java.lang.Class loadClass()
        Specified by:
        loadClass in class Type
      • destroy

        protected void destroy()
        Release all resources
        Overrides:
        destroy in class Type