|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.cunit.threadCheck.predicates.ThreadCheckPredicates
public class ThreadCheckPredicates
Class containing several common predicates.
Constructor Summary | |
---|---|
ThreadCheckPredicates()
|
Method Summary | |
---|---|
static boolean |
checkDistinctArguments(java.lang.Object thisObject,
java.lang.Object[] args,
int[] value)
Return true if the object with the specified indices are all distinct. |
static boolean |
checkEventThread(java.lang.Object thisObject)
Return true if the current thread is the event thread. |
static boolean |
checkEventThreadAfterRealized(java.lang.Object thisObject)
Return true if the current thread is the event thread, or if thisObject is an instance of a subclass of java.awt.Component and that component has not been realized yet. |
static boolean |
checkGroup(java.lang.Object thisObject,
java.lang.String value,
boolean regex)
Return true if the current thread's group equals the specified string |
static boolean |
checkMonitorNotOwned(java.lang.Object o)
Return true if the current thread does not own the monitor of the object. |
static boolean |
checkMonitorNotOwnedArgument(java.lang.Object thisObject,
java.lang.Object[] args,
int value)
Return true if the current thread does not own the monitor of the object with index value in the array of method arguments |
static boolean |
checkMonitorNotOwnedArgumentByAnyThread(java.lang.Object thisObject,
java.lang.Object[] args,
int value)
Return true if the current thread does not own the monitor of the object with index value in the array of method arguments |
static boolean |
checkMonitorNotOwnedByAnyThread(java.lang.Object o)
Return true if the no thread owns the monitor of the object. |
static boolean |
checkMonitorOwned(java.lang.Object o)
Return true if the current thread owns the monitor of the object. |
static boolean |
checkMonitorOwnedArgument(java.lang.Object thisObject,
java.lang.Object[] args,
int value)
Return true if the current thread owns the monitor of the object with index value in the array of method arguments |
static boolean |
checkMonitorOwnedArgumentByAnyThread(java.lang.Object thisObject,
java.lang.Object[] args,
int value)
Return true if the any thread owns the monitor of the object with index value in the array of method arguments |
static boolean |
checkMonitorOwnedByAnyThread(java.lang.Object o)
Return true if the any thread owns the monitor of the object. |
static boolean |
checkName(java.lang.Object thisObject,
java.lang.String value,
boolean regex)
Return true if the current thread's name equals the specified string |
static boolean |
checkNotNullArgument(java.lang.Object thisObject,
java.lang.Object[] args,
int value)
Return true if the object with index value in the array of method arguments is not null. |
static boolean |
checkNullArgument(java.lang.Object thisObject,
java.lang.Object[] args,
int value)
Return true if the object with index value in the array of method arguments is null. |
static boolean |
checkNumberBoundedArgument(java.lang.Object thisObject,
java.lang.Object[] args,
NumberBoundedArgument.Mode mode,
int index,
double bound,
double upperBound)
Return true if the object with the specified index is a Number and meeds the bounds. |
static boolean |
checkSameArguments(java.lang.Object thisObject,
java.lang.Object[] args,
int[] value)
Return true if the object with the specified indices are all the same. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadCheckPredicates()
Method Detail |
---|
public static boolean checkEventThread(java.lang.Object thisObject)
thisObject
- "this" at the time of the check, or null if not available; ignored by this method
public static boolean checkEventThreadAfterRealized(java.lang.Object thisObject)
thisObject
- "this" at the time of the check, or null if not available; ignored by this method
public static boolean checkName(java.lang.Object thisObject, java.lang.String value, boolean regex)
thisObject
- "this" at the time of the check, or null if not available; ignored by this methodvalue
- string to compare the current thread's name toregex
- true if value should be treated as a regular expression
public static boolean checkGroup(java.lang.Object thisObject, java.lang.String value, boolean regex)
thisObject
- "this" at the time of the check, or null if not available; ignored by this methodvalue
- string to compare the current thread's group toregex
- true if value should be treated as a regular expression
public static boolean checkMonitorOwned(java.lang.Object o)
o
- object whose monitor should be checked; must be non-null
public static boolean checkMonitorNotOwned(java.lang.Object o)
o
- object whose monitor should be checked; must be non-null
public static boolean checkMonitorOwnedArgument(java.lang.Object thisObject, java.lang.Object[] args, int value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- index of the method argument that should be checked
public static boolean checkMonitorNotOwnedArgument(java.lang.Object thisObject, java.lang.Object[] args, int value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- index of the method argument that should be checked
public static boolean checkMonitorOwnedByAnyThread(java.lang.Object o)
o
- object whose monitor should be checked; must be non-null
public static boolean checkMonitorNotOwnedByAnyThread(java.lang.Object o)
o
- object whose monitor should be checked; must be non-null
public static boolean checkMonitorOwnedArgumentByAnyThread(java.lang.Object thisObject, java.lang.Object[] args, int value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- index of the method argument that should be checked
public static boolean checkMonitorNotOwnedArgumentByAnyThread(java.lang.Object thisObject, java.lang.Object[] args, int value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- index of the method argument that should be checked
public static boolean checkNullArgument(java.lang.Object thisObject, java.lang.Object[] args, int value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- index of the method argument that should be checked
public static boolean checkNotNullArgument(java.lang.Object thisObject, java.lang.Object[] args, int value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- index of the method argument that should be checked
public static boolean checkNumberBoundedArgument(java.lang.Object thisObject, java.lang.Object[] args, NumberBoundedArgument.Mode mode, int index, double bound, double upperBound)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsmode
- bounding modeindex
- index of the method argument that should be checkedbound
- boundupperBound
- upper bound
public static boolean checkDistinctArguments(java.lang.Object thisObject, java.lang.Object[] args, int[] value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- array of indices of the method argument that should be checked
public static boolean checkSameArguments(java.lang.Object thisObject, java.lang.Object[] args, int[] value)
thisObject
- object that represents "this", or null if staticargs
- array of method argumentsvalue
- array of indices of the method argument that should be checked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |