edu.rice.cs.cunit.instrumentors.threadCheck
Class ThreadCheckDefinitionRecord

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.threadCheck.ThreadCheckDefinitionRecord
All Implemented Interfaces:
java.io.Serializable

public class ThreadCheckDefinitionRecord
extends java.lang.Object
implements java.io.Serializable

Class that keeps track an invariant (ThreadCheckAnnotationRecord) and the classes and methods its applied to.

See Also:
Serialized Form

Field Summary
 java.util.HashSet<java.lang.String> classNames
          A set of class names.
 ThreadCheckAnnotationRecord invariant
          The invariant applied to the classes and methods below.
 java.util.HashMap<java.lang.String,java.lang.Boolean> methodClassAndSigs
          A map of method strings, generated by concatenating the class name, "::" and the method signature.
 
Constructor Summary
ThreadCheckDefinitionRecord(ThreadCheckAnnotationRecord inv)
          Create a new empty definition record that just specifies the invariant.
 
Method Summary
 void addClass(java.lang.String className)
          Add the specified class to the set of classes.
 void addMethod(java.lang.String className, java.lang.String methodSig, boolean suppressSubtypingWarning)
          Add the specified method to the set of methods.
 boolean appliesToClass(java.lang.String className)
          Return true if the invariant applies to the specified class.
 boolean appliesToMethod(java.lang.String className, java.lang.String methodSig)
          Return true if the invariant applies to the specified method.
 boolean empty()
          Return true if there is nothing specified in this definition record.
 boolean equals(java.lang.Object o)
          Returns true if the two ThreadCheckDefinitionRecords are equal.
 ThreadCheckAnnotationRecord getInvariant()
          Return the invariant of this definition.
 int hashCode()
          Return a hashcode for this ThreadCheckDefinitionRecord.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

invariant

public final ThreadCheckAnnotationRecord invariant
The invariant applied to the classes and methods below.


classNames

public final java.util.HashSet<java.lang.String> classNames
A set of class names.


methodClassAndSigs

public final java.util.HashMap<java.lang.String,java.lang.Boolean> methodClassAndSigs
A map of method strings, generated by concatenating the class name, "::" and the method signature. Example: The method "void run()" in the class "sample.threadCheck.ThreadCheckSample4" has the string "sample.threadCheck.ThreadCheckSample4::run()V". The value is true if subtyping warnings should be suppressed.

Constructor Detail

ThreadCheckDefinitionRecord

public ThreadCheckDefinitionRecord(ThreadCheckAnnotationRecord inv)
Create a new empty definition record that just specifies the invariant.

Parameters:
inv - the invariant of this definition
Method Detail

addClass

public void addClass(java.lang.String className)
Add the specified class to the set of classes.

Parameters:
className - name of the class

addMethod

public void addMethod(java.lang.String className,
                      java.lang.String methodSig,
                      boolean suppressSubtypingWarning)
Add the specified method to the set of methods.

Parameters:
className - name of the class
methodSig - signature of the method
suppressSubtypingWarning - true if subtyping warnings should be suppressed

appliesToClass

public boolean appliesToClass(java.lang.String className)
Return true if the invariant applies to the specified class.

Parameters:
className - name of the class
Returns:
true if the invariant applies

appliesToMethod

public boolean appliesToMethod(java.lang.String className,
                               java.lang.String methodSig)
Return true if the invariant applies to the specified method.

Parameters:
className - name of the class
methodSig - signature of the method
Returns:
true if the invariant applies

getInvariant

public ThreadCheckAnnotationRecord getInvariant()
Return the invariant of this definition.

Returns:
the invariant, a ThreadCheckAnnotationRecord

empty

public boolean empty()
Return true if there is nothing specified in this definition record.

Returns:
true if nothing specified

equals

public boolean equals(java.lang.Object o)
Returns true if the two ThreadCheckDefinitionRecords are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - other object
Returns:
true if equal

hashCode

public int hashCode()
Return a hashcode for this ThreadCheckDefinitionRecord.

Overrides:
hashCode in class java.lang.Object
Returns:
hashcode

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.