Class TypeName

  • All Implemented Interfaces:
    Serializable

    public final class TypeName
    extends Object
    implements Serializable
    We've introduced this class to canonicalize Atoms that represent package names. NB: All package names should use '/' and not '.' as a separator. eg. Ljava/lang/Class
    See Also:
    Serialized Form
    • Method Detail

      • findOrCreateClass

        public static TypeName findOrCreateClass​(Atom packageName,
                                                 Atom className)
      • findOrCreate

        public static TypeName findOrCreate​(Atom packageName,
                                            Atom className,
                                            int dim)
      • hashCode

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

        public String toUnicodeString()
      • findOrCreateClassName

        public static TypeName findOrCreateClassName​(String packageName,
                                                     String className)
      • parseForArrayElementName

        public TypeName parseForArrayElementName()
        Returns:
        the name of the array element type for an array
      • getArrayTypeForElementType

        public TypeName getArrayTypeForElementType()
      • getPointerTypeForElementType

        public TypeName getPointerTypeForElementType()
      • getReferenceTypeForElementType

        public TypeName getReferenceTypeForElementType()
      • getDerivedMask

        public final int getDerivedMask()
        Returns:
        the dimensionality of the type. By convention, class types have dimensionality 0, primitives -1, and arrays the number of [ in their descriptor.
      • isClassType

        public final boolean isClassType()
        Does 'this' refer to a class?
      • isArrayType

        public final boolean isArrayType()
        Does 'this' refer to an array?
      • isPrimitiveType

        public final boolean isPrimitiveType()
        Does 'this' refer to a primitive type
      • getInnermostElementType

        public final TypeName getInnermostElementType()
        Return the innermost element type reference for an array
      • getPackage

        public Atom getPackage()
        Returns:
        the Atom naming the package for this type.
      • getClassName

        public Atom getClassName()
        Returns:
        the Atom naming the class for this type (without package)