Class ReferenceType

  • All Implemented Interfaces:
    IRType

    public final class ReferenceType
    extends Object
    implements IRType
    Represents a reference type (class or interface).
    • Constructor Detail

      • ReferenceType

        public ReferenceType​(String internalName)
        Creates a reference type with the given internal name.
        Parameters:
        internalName - the internal class name
    • Method Detail

      • getInternalName

        public String getInternalName()
        Returns:
        the internal name
      • getDescriptor

        public String getDescriptor()
        Specified by:
        getDescriptor in interface IRType
        Returns:
        the JVM type descriptor for this type
      • getSize

        public int getSize()
        Specified by:
        getSize in interface IRType
        Returns:
        the number of stack or local slots a value of this type occupies
      • isReference

        public boolean isReference()
        Specified by:
        isReference in interface IRType
        Returns:
        true for object and array types
      • isPrimitive

        public boolean isPrimitive()
        Specified by:
        isPrimitive in interface IRType
        Returns:
        true for the eight primitive types
      • isVoid

        public boolean isVoid()
        Specified by:
        isVoid in interface IRType
        Returns:
        true for the void type
      • isArray

        public boolean isArray()
        Specified by:
        isArray in interface IRType
        Returns:
        true for array types
      • isTwoSlot

        public boolean isTwoSlot()
        Specified by:
        isTwoSlot in interface IRType
        Returns:
        true for long and double, which occupy two slots
      • getSimpleName

        public String getSimpleName()
        Gets the simple class name without package.
        Returns:
        the simple name
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object