|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdiagnose.concurrent.SynchronizedVariable org.jdiagnose.concurrent.SynchronizedBoolean
A class useful for offloading synch for boolean instance variables.
[ Introduction to this package. ]
Field Summary | |
protected boolean |
value_
|
Fields inherited from class org.jdiagnose.concurrent.SynchronizedVariable |
lock_ |
Constructor Summary | |
SynchronizedBoolean(boolean initialValue)
Make a new SynchronizedBoolean with the given initial value, and using its own internal lock. |
|
SynchronizedBoolean(boolean initialValue,
java.lang.Object lock)
Make a new SynchronizedBoolean with the given initial value, and using the supplied lock. |
Method Summary | |
boolean |
and(boolean b)
Set value to value & b. |
boolean |
commit(boolean assumedValue,
boolean newValue)
Set value to newValue only if it is currently assumedValue. |
int |
compareTo(boolean other)
|
int |
compareTo(java.lang.Object other)
|
int |
compareTo(SynchronizedBoolean other)
|
boolean |
complement()
Set the value to its complement |
boolean |
equals(java.lang.Object other)
|
boolean |
get()
Return the current value |
int |
hashCode()
|
boolean |
or(boolean b)
Set value to value | b. |
boolean |
set(boolean newValue)
Set to newValue. |
boolean |
swap(SynchronizedBoolean other)
Atomically swap values with another SynchronizedBoolean. |
java.lang.String |
toString()
|
boolean |
xor(boolean b)
Set value to value ^ b. |
Methods inherited from class org.jdiagnose.concurrent.SynchronizedVariable |
execute, getLock |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean value_
Constructor Detail |
public SynchronizedBoolean(boolean initialValue)
public SynchronizedBoolean(boolean initialValue, java.lang.Object lock)
Method Detail |
public final boolean get()
public boolean set(boolean newValue)
public boolean commit(boolean assumedValue, boolean newValue)
public boolean swap(SynchronizedBoolean other)
public boolean complement()
public boolean and(boolean b)
public boolean or(boolean b)
public boolean xor(boolean b)
public int compareTo(boolean other)
public int compareTo(SynchronizedBoolean other)
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |