Class PointerType

  • All Implemented Interfaces:
    Persistable, SecondOrderType, IVisitable<Node>

    public class PointerType
    extends Type
    implements SecondOrderType
    PointerTypes represent all references to other Types. For C/CPP this includes pointers, as well as arrays, since technically arrays are pointers. For JAVA the only use case are arrays as there is no such pointer concept.
    • Method Detail

      • reference

        public PointerType reference​(PointerType.PointerOrigin origin)
        Specified by:
        reference in class Type
        Parameters:
        origin - Reason for the reference (array of pointer)
        Returns:
        referencing a PointerType results in another PointerType wrapping the first PointerType, e.g. int**
      • dereference

        public Type dereference()
        Specified by:
        dereference in class Type
        Returns:
        dereferencing a PointerType yields the type the pointer was pointing towards
      • refreshNames

        public void refreshNames()
        Overrides:
        refreshNames in class Type
      • duplicate

        public Type duplicate()
        Specified by:
        duplicate in class Type
        Returns:
        Creates an exact copy of the current type (chain)
      • isArray

        public boolean isArray()
      • isSimilar

        public boolean isSimilar​(Type t)
        Description copied from class: Type
        Required for possibleSubTypes to check if the new Type should be considered a subtype or not
        Overrides:
        isSimilar in class Type
        Parameters:
        t - other type the similarity is checked with
        Returns:
        True if the parameter t is equal to the current type (this)
      • getReferenceDepth

        public int getReferenceDepth()
        Overrides:
        getReferenceDepth in class Type
        Returns:
        number of steps that are required in order to traverse the type chain until the root is reached
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class Type
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Type
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Type