|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | 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
public class WaitableBoolean
A class useful for offloading synch for boolean instance variables.
[ Introduction to this package. ]
Field Summary |
---|
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean |
---|
value_ |
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable |
---|
lock_ |
Constructor Summary | |
---|---|
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. |
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,
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. |
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 |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WaitableBoolean(boolean initialValue)
public WaitableBoolean(boolean initialValue, java.lang.Object lock)
Method Detail |
---|
public boolean set(boolean newValue)
SynchronizedBoolean
set
in class SynchronizedBoolean
public boolean commit(boolean assumedValue, boolean newValue)
SynchronizedBoolean
commit
in class SynchronizedBoolean
public boolean complement()
SynchronizedBoolean
complement
in class SynchronizedBoolean
public boolean and(boolean b)
SynchronizedBoolean
and
in class SynchronizedBoolean
public boolean or(boolean b)
SynchronizedBoolean
or
in class SynchronizedBoolean
public boolean xor(boolean b)
SynchronizedBoolean
xor
in class SynchronizedBoolean
public void whenFalse(java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenTrue(java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenEqual(boolean c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenNotEqual(boolean c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |