EDU.oswego.cs.dl.util.concurrent
Class WaitableBoolean
public
class
WaitableBoolean
extends SynchronizedBoolean
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) |
boolean | commit(boolean assumedValue, boolean newValue) |
boolean | complement() |
boolean | or(boolean b) |
boolean | set(boolean 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) |
public WaitableBoolean(boolean initialValue)
Make a new WaitableBoolean with the given initial value *
public WaitableBoolean(boolean initialValue, Object lock)
Make a new WaitableBoolean with the given initial value,
and using the supplied lock.
public boolean and(boolean b)
public boolean commit(boolean assumedValue, boolean newValue)
public boolean complement()
public boolean or(boolean b)
public boolean set(boolean newValue)
public void whenEqual(boolean c, Runnable action)
Wait until value equals c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenFalse(Runnable action)
Wait until value is false, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenNotEqual(boolean c, Runnable action)
wait until value not equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenTrue(Runnable action)
wait until value is true, then run action if nonnull.
The action is run with the synchronization lock held.
public boolean xor(boolean b)