daikon
Class PptName

Object
  extended by 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
PptName(String name)
           
PptName(String className, String methodName, String pointName)
          className or methodName (or both) must be non-null
 
Method Summary
 boolean equals(Object o)
           
 boolean equals(PptName o)
           
 String exitLine()
           
 String getFullClassName()
           
 String getMethodName()
           
 String getName()
           
 String getNameWithoutPoint()
           
 String getPackageName()
           
 String getPoint()
           
 int getPointSubscript()
           
 String getShortClassName()
           
 String getSignature()
           
 int hashCode()
           
 boolean isClassStaticSynthetic()
           
 boolean isCombinedExitPoint()
           
 boolean isConstructor()
           
 boolean isEnterPoint()
           
 boolean isExitPoint()
           
 boolean isGlobalPoint()
           
 boolean isNumberedExitPoint()
           
 boolean isObjectInstanceSynthetic()
           
 boolean isThrowsPoint()
           
 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()
           
 String repr()
          Debugging output
 String toString()
           
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PptName

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

PptName

public PptName(String className,
               String methodName,
               String pointName)
className or methodName (or both) must be non-null

Method Detail

name

public String name()
Returns:
getName() [convenience accessor]
See Also:
getName()

getName

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

getFullClassName

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

getShortClassName

public 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"

getPackageName

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

getSignature

public 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;"

getMethodName

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

getNameWithoutPoint

public 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;"

getPoint

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

getPointSubscript

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

isObjectInstanceSynthetic

public boolean isObjectInstanceSynthetic()
Returns:
true iff this name refers to a synthetic object instance program point

isClassStaticSynthetic

public boolean isClassStaticSynthetic()
Returns:
true iff this name refers to a synthetic class instance program point

isGlobalPoint

public boolean isGlobalPoint()
Returns:
true iff this name refers to program globals

isExitPoint

public boolean isExitPoint()
Returns:
true iff this name refers to a procedure exit point

isThrowsPoint

public boolean isThrowsPoint()
Returns:
true iff this name refers to an abrupt completion point

isCombinedExitPoint

public boolean isCombinedExitPoint()
Returns:
true iff this name refers to a combined (synthetic) procedure exit point

isNumberedExitPoint

public boolean isNumberedExitPoint()
Returns:
true iff this name refers to an actual (not combined) procedure exit point (eg, EXIT22)

isEnterPoint

public boolean isEnterPoint()
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, return an empty string
See Also:
getPointSubscript()

isConstructor

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 . The newer declaration format does not have but their method name includes the class name. For compatibility both mechanisms are checked.

repr

public String repr()
Debugging output


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

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

equals

public boolean equals(PptName o)

hashCode

public int hashCode()
Overrides:
hashCode in class Object