Package daikon

Class PptName

  • All Implemented Interfaces:
    Serializable

    public class PptName
    extends Object
    implements Serializable
    PptName is an immutable ADT that represents naming data associated with a given program point, such as the class or method.

    Examples below are as if the full value of this PptName were "DataStructures.StackAr.pop()Ljava/lang/Object;:::EXIT84"

    PptName is deprecated, because declaration file format 2 should not need it. Uses of PptName should be eliminated.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PptName​(@Nullable String className, @Nullable String methodName, String pointName)
      Creates a new PptName.
      PptName​(String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(@GuardSatisfied @Nullable Object o)  
      boolean equalsPptName​(@GuardSatisfied PptName o)  
      String exitLine()
      Returns a string containing the line number, if this is an exit point; otherwise, returns an empty string.
      @Nullable String getFullClassName()
      Returns the fully-qualified class name, which uniquely identifies a given class.
      @Nullable String getMethodName()
      Returns the name (identifier) of the method, not taking into account any arguments, return values, etc.
      String getName()
      Returns the complete program point name, e.g., "DataStructures.StackAr.pop()Ljava/lang/Object;:::EXIT84".
      @Nullable @Interned String getNameWithoutPoint()
      Returns the fully-qualified class and method name (and signature).
      @Nullable String getPackageName()
      Returns a guess at the package name.
      @Nullable String getPoint()
      Returns something interesting and descriptive about this point, along the lines of "ENTER" or "EXIT" or some such.
      int getPointSubscript()
      Returns a numerical subscript of the given point, or Integer.MIN_VALUE if none exists. e.g
      @Nullable String getShortClassName()
      Returns the short name of the class, not including any additional context, such as the package it is in.
      @Nullable String getSignature()
      Returns the full name which can uniquely identify a method within a class.
      int hashCode()  
      boolean isClassStaticSynthetic()
      Returns true iff this name refers to a synthetic class instance program point.
      boolean isCombinedExitPoint()
      Returns true iff this name refers to a combined (synthetic) procedure exit point.
      boolean isConstructor()
      Returns true iff this program point is a constructor entry or exit.
      boolean isEnterPoint()
      Returns true iff this name refers to a procedure exit point.
      boolean isExitPoint()
      Returns true iff this name refers to a procedure exit point.
      boolean isGlobalPoint()
      Returns true iff this name refers to program globals.
      boolean isNumberedExitPoint()
      Returns true iff this name refers to an actual (not combined) procedure exit point (eg, EXIT22).
      boolean isObjectInstanceSynthetic()
      Returns true iff this name refers to a synthetic object instance program point.
      boolean isThrowsPoint()
      Returns true iff this name refers to an abrupt completion point.
      PptName makeClassStatic()
      Requires: this.isExitPoint() || this.isEnterPoint() || this.isObjectInstanceSynthetic()
      PptName makeEnter()
      Requires: this.isExitPoint()
      PptName makeExit()
      Requires: this.isExitPoint() || this.isEnterPoint()
      PptName makeObject()
      Requires: this.isExitPoint() || this.isEnterPoint()
      String name()
      Returns getName() [convenience accessor].
      String repr()
      Debugging output.
      String toString()  
    • Constructor Detail

      • PptName

        public PptName​(String name)
        Parameters:
        name - non-null ppt name as given in the decls file
      • PptName

        public PptName​(@Nullable String className,
                       @Nullable String methodName,
                       String pointName)
        Creates a new PptName. className or methodName (or both) must be non-null.
        Parameters:
        className - fully-qualified class name
        methodName - method signature, including types
        pointName - post-separator (separator is ":::")
    • Method Detail

      • name

        @Pure
        public String name()
        Returns getName() [convenience accessor].
        Returns:
        getName() [convenience accessor]
        See Also:
        getName()
      • getName

        @Pure
        public String getName()
        Returns the complete program point name, e.g., "DataStructures.StackAr.pop()Ljava/lang/Object;:::EXIT84".
        Returns:
        the complete program point name
      • getFullClassName

        public @Nullable String getFullClassName()
        Returns the fully-qualified class name, which uniquely identifies a given class. May be null. e.g. "DataStructures.StackAr".
        Returns:
        the fully-qualified class name
      • getShortClassName

        public @Nullable String getShortClassName()
        Returns the short name of the class, not including any additional context, such as the package it is in. May be null. e.g. "StackAr".
        Returns:
        the short name of the class, or null
      • getPackageName

        public @Nullable String getPackageName()
        Returns a guess at the package name. May be null.
        Returns:
        a guess at the package name. May be null
      • getSignature

        public @Nullable String getSignature()
        Returns the full name which can uniquely identify a method within a class. The name includes symbols for the argument types and return type. May be null. e.g. "pop()Ljava/lang/Object;".
        Returns:
        the full name which can uniquely identify a method within a class
      • getMethodName

        public @Nullable String getMethodName()
        Returns the name (identifier) of the method, not taking into account any arguments, return values, etc. May be null. e.g. "pop".
        Returns:
        the name (identifier) of the method, or null
      • getNameWithoutPoint

        public @Nullable @Interned String getNameWithoutPoint()
        Returns the fully-qualified class and method name (and signature). Does not include any point information (such as ENTER or EXIT). May be null. e.g. "DataStructures.StackAr.pop()Ljava/lang/Object;"
        Returns:
        the fully-qualified class and method name (and signature)
      • getPoint

        public @Nullable String getPoint()
        Returns something interesting and descriptive about this point, along the lines of "ENTER" or "EXIT" or some such. The semantics of this method are not yet decided, so don't try to do anything useful with this result. May be null. e.g. "EXIT84".
        Returns:
        something interesting and descriptive about this
      • getPointSubscript

        public int getPointSubscript()
        Returns a numerical subscript of the given point, or Integer.MIN_VALUE if none exists. e.g. "84".
        Returns:
        a numerical subscript of the given point, or Integer.MIN_VALUE if none exists
        See Also:
        exitLine()
      • isObjectInstanceSynthetic

        @Pure
        public boolean isObjectInstanceSynthetic()
        Returns true iff this name refers to a synthetic object instance program point.
        Returns:
        true iff this name refers to a synthetic object instance program point
      • isClassStaticSynthetic

        @Pure
        public boolean isClassStaticSynthetic()
        Returns true iff this name refers to a synthetic class instance program point.
        Returns:
        true iff this name refers to a synthetic class instance program point
      • isGlobalPoint

        @Pure
        public boolean isGlobalPoint()
        Returns true iff this name refers to program globals.
        Returns:
        true iff this name refers to program globals
      • isExitPoint

        @EnsuresNonNullIf(result=true,
                          expression="point")
        @Pure
        public boolean isExitPoint()
        Returns true iff this name refers to a procedure exit point.
        Returns:
        true iff this name refers to a procedure exit point
      • isThrowsPoint

        @EnsuresNonNullIf(result=true,
                          expression="point")
        @Pure
        public boolean isThrowsPoint()
        Returns true iff this name refers to an abrupt completion point.
        Returns:
        true iff this name refers to an abrupt completion point
      • isCombinedExitPoint

        @EnsuresNonNullIf(result=true,
                          expression="point")
        @Pure
        public boolean isCombinedExitPoint()
        Returns true iff this name refers to a combined (synthetic) procedure exit point.
        Returns:
        true iff this name refers to a combined (synthetic) procedure exit point
      • isNumberedExitPoint

        @EnsuresNonNullIf(result=true,
                          expression="point")
        @Pure
        public boolean isNumberedExitPoint()
        Returns true iff this name refers to an actual (not combined) procedure exit point (eg, EXIT22).
        Returns:
        true iff this name refers to an actual (not combined) procedure exit point
      • isEnterPoint

        @EnsuresNonNullIf(result=true,
                          expression="point")
        @Pure
        public boolean isEnterPoint()
        Returns true iff this name refers to a procedure exit point.
        Returns:
        true iff this name refers to a procedure exit point
      • exitLine

        public String exitLine()
        Returns a string containing the line number, if this is an exit point; otherwise, returns an empty string.
        Returns:
        a string containing the line number, if this is an exit point; otherwise, return an empty string
        See Also:
        getPointSubscript()
      • isConstructor

        @Pure
        public boolean isConstructor()
        Returns true iff this program point is a constructor entry or exit. There are two ways in which this works. With the older declaration format, the method name starts with <init>. The newer declaration format does not have <init> but their method name includes the class name. For compatibility both mechanisms are checked.
        Returns:
        true iff this program point is a constructor entry or exit
      • repr

        public String repr()
        Debugging output.
        Returns:
        a string representation of this
      • makeEnter

        public PptName makeEnter()
        Requires: this.isExitPoint()
        Returns:
        a name for the corresponding enter point
      • makeExit

        public PptName makeExit()
        Requires: this.isExitPoint() || this.isEnterPoint()
        Returns:
        a name for the combined exit point
      • makeObject

        public PptName makeObject()
        Requires: this.isExitPoint() || this.isEnterPoint()
        Returns:
        a name for the corresponding object invariant
      • makeClassStatic

        public PptName makeClassStatic()
        Requires: this.isExitPoint() || this.isEnterPoint() || this.isObjectInstanceSynthetic()
        Returns:
        a name for the corresponding class-static invariant
      • equals

        @EnsuresNonNullIf(result=true,
                          expression="#1")
        @Pure
        public boolean equals​(@GuardSatisfied PptName this,
                              @GuardSatisfied @Nullable Object o)
        Overrides:
        equals in class Object
      • equalsPptName

        @EnsuresNonNullIf(result=true,
                          expression="#1")
        @Pure
        public boolean equalsPptName​(@GuardSatisfied PptName this,
                                     @GuardSatisfied PptName o)
      • hashCode

        @Pure
        public int hashCode​(@GuardSatisfied PptName this)
        Overrides:
        hashCode in class Object