public class WaitableBoolean extends SynchronizedBoolean
value_lock_| Constructor and Description |
|---|
WaitableBoolean(boolean initialValue)
Make a new WaitableBoolean with the given initial value
|
WaitableBoolean(boolean initialValue,
java.lang.Object lock)
Make a new WaitableBoolean with the given initial value,
and using the supplied lock.
|
| Modifier and Type | Method and Description |
|---|---|
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,
java.lang.Runnable action)
Wait until value equals c, then run action if nonnull.
|
void |
whenFalse(java.lang.Runnable action)
Wait until value is false, then run action if nonnull.
|
void |
whenNotEqual(boolean c,
java.lang.Runnable action)
wait until value not equal to c, then run action if nonnull.
|
void |
whenTrue(java.lang.Runnable action)
wait until value is true, then run action if nonnull.
|
boolean |
xor(boolean b)
Set value to value ^ b.
|
compareTo, compareTo, compareTo, equals, get, hashCode, swap, toStringexecute, getLockpublic WaitableBoolean(boolean initialValue)
public WaitableBoolean(boolean initialValue,
java.lang.Object lock)
public boolean set(boolean newValue)
SynchronizedBooleanset in class SynchronizedBooleanpublic boolean commit(boolean assumedValue,
boolean newValue)
SynchronizedBooleancommit in class SynchronizedBooleanpublic boolean complement()
SynchronizedBooleancomplement in class SynchronizedBooleanpublic boolean and(boolean b)
SynchronizedBooleanand in class SynchronizedBooleanpublic boolean or(boolean b)
SynchronizedBooleanor in class SynchronizedBooleanpublic boolean xor(boolean b)
SynchronizedBooleanxor in class SynchronizedBooleanpublic void whenFalse(java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenTrue(java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenEqual(boolean c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenNotEqual(boolean c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedException