|
Colt 1.0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.oswego.cs.dl.util.concurrent.SynchronizedVariable | +--edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean | +--edu.oswego.cs.dl.util.concurrent.WaitableBoolean
A class useful for offloading synch for boolean instance variables.
[ Introduction to this package. ]
Constructor Summary | |
WaitableBoolean(boolean initialValue)
Make a new WaitableBoolean with the given initial value |
|
WaitableBoolean(boolean initialValue,
Object lock)
Make a new WaitableBoolean 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. |
boolean |
complement()
Set the value to its complement |
boolean |
or(boolean b)
Set value to value | b. |
boolean |
set(boolean newValue)
Set to newValue. |
void |
whenEqual(boolean c,
Runnable action)
Wait until value equals c, then run action if nonnull. |
void |
whenFalse(Runnable action)
Wait until value is false, then run action if nonnull. |
void |
whenNotEqual(boolean c,
Runnable action)
wait until value not equal to c, then run action if nonnull. |
void |
whenTrue(Runnable action)
wait until value is true, then run action if nonnull. |
boolean |
xor(boolean b)
Set value to value ^ b. |
Methods inherited from class edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean |
compareTo, compareTo, compareTo, equals, get, hashCode, swap, toString |
Methods inherited from class edu.oswego.cs.dl.util.concurrent.SynchronizedVariable |
execute, getLock |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public WaitableBoolean(boolean initialValue)
public WaitableBoolean(boolean initialValue, Object lock)
Method Detail |
public boolean set(boolean newValue)
SynchronizedBoolean
set
in class SynchronizedBoolean
edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean
public boolean commit(boolean assumedValue, boolean newValue)
SynchronizedBoolean
commit
in class SynchronizedBoolean
edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean
public boolean complement()
SynchronizedBoolean
complement
in class SynchronizedBoolean
edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean
public boolean and(boolean b)
SynchronizedBoolean
and
in class SynchronizedBoolean
edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean
public boolean or(boolean b)
SynchronizedBoolean
or
in class SynchronizedBoolean
edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean
public boolean xor(boolean b)
SynchronizedBoolean
xor
in class SynchronizedBoolean
edu.oswego.cs.dl.util.concurrent.SynchronizedBoolean
public void whenFalse(Runnable action) throws InterruptedException
public void whenTrue(Runnable action) throws InterruptedException
public void whenEqual(boolean c, Runnable action) throws InterruptedException
public void whenNotEqual(boolean c, Runnable action) throws InterruptedException
|
Colt 1.0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |