Package daikon
Class PptName
- Object
-
- 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(@GuardSatisfied @Nullable Object o)booleanequalsPptName(@GuardSatisfied PptName o)StringexitLine()Returns a string containing the line number, if this is an exit point; otherwise, returns an empty string.@Nullable StringgetFullClassName()Returns the fully-qualified class name, which uniquely identifies a given class.@Nullable StringgetMethodName()Returns the name (identifier) of the method, not taking into account any arguments, return values, etc.StringgetName()Returns the complete program point name, e.g., "DataStructures.StackAr.pop()Ljava/lang/Object;:::EXIT84".@Nullable @Interned StringgetNameWithoutPoint()Returns the fully-qualified class and method name (and signature).@Nullable StringgetPackageName()Returns a guess at the package name.@Nullable StringgetPoint()Returns something interesting and descriptive about this point, along the lines of "ENTER" or "EXIT" or some such.intgetPointSubscript()Returns a numerical subscript of the given point, or Integer.MIN_VALUE if none exists. e.g@Nullable StringgetShortClassName()Returns the short name of the class, not including any additional context, such as the package it is in.@Nullable StringgetSignature()Returns the full name which can uniquely identify a method within a class.inthashCode()booleanisClassStaticSynthetic()Returns true iff this name refers to a synthetic class instance program point.booleanisCombinedExitPoint()Returns true iff this name refers to a combined (synthetic) procedure exit point.booleanisConstructor()Returns true iff this program point is a constructor entry or exit.booleanisEnterPoint()Returns true iff this name refers to a procedure exit point.booleanisExitPoint()Returns true iff this name refers to a procedure exit point.booleanisGlobalPoint()Returns true iff this name refers to program globals.booleanisNumberedExitPoint()Returns true iff this name refers to an actual (not combined) procedure exit point (eg, EXIT22).booleanisObjectInstanceSynthetic()Returns true iff this name refers to a synthetic object instance program point.booleanisThrowsPoint()Returns true iff this name refers to an abrupt completion point.PptNamemakeClassStatic()Requires: this.isExitPoint() || this.isEnterPoint() || this.isObjectInstanceSynthetic()PptNamemakeEnter()Requires: this.isExitPoint()PptNamemakeExit()Requires: this.isExitPoint() || this.isEnterPoint()PptNamemakeObject()Requires: this.isExitPoint() || this.isEnterPoint()Stringname()Returns getName() [convenience accessor].Stringrepr()Debugging output.StringtoString()
-
-
-
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.classNameormethodName(or both) must be non-null.- Parameters:
className- fully-qualified class namemethodName- method signature, including typespointName- 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
-
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)
-
equalsPptName
@EnsuresNonNullIf(result=true, expression="#1") @Pure public boolean equalsPptName(@GuardSatisfied PptName this, @GuardSatisfied PptName o)
-
-