EDU.oswego.cs.dl.util.concurrent
Class WaitableChar
public
class
WaitableChar
extends SynchronizedChar
Constructor Summary |
| WaitableChar(char initialValue)
Make a new WaitableChar with the given initial value,
and using its own internal lock.
|
| WaitableChar(char initialValue, Object lock)
Make a new WaitableChar with the given initial value,
and using the supplied lock.
|
Method Summary |
char | add(char amount) |
boolean | commit(char assumedValue, char newValue) |
char | divide(char factor) |
char | multiply(char factor) |
char | set(char newValue) |
char | subtract(char amount) |
void | whenEqual(char c, Runnable action)
Wait until value equals c, then run action if nonnull.
|
void | whenGreater(char c, Runnable action)
wait until value greater than c, then run action if nonnull.
|
void | whenGreaterEqual(char c, Runnable action)
wait until value greater than or equal to c, then run action if nonnull.
|
void | whenLess(char c, Runnable action)
wait until value less than c, then run action if nonnull.
|
void | whenLessEqual(char c, Runnable action)
wait until value less than or equal to c, then run action if nonnull.
|
void | whenNotEqual(char c, Runnable action)
wait until value not equal to c, then run action if nonnull.
|
public WaitableChar(char initialValue)
Make a new WaitableChar with the given initial value,
and using its own internal lock.
public WaitableChar(char initialValue, Object lock)
Make a new WaitableChar with the given initial value,
and using the supplied lock.
public char add(char amount)
public boolean commit(char assumedValue, char newValue)
public char divide(char factor)
public char multiply(char factor)
public char set(char newValue)
public char subtract(char amount)
public void whenEqual(char c, Runnable action)
Wait until value equals c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenGreater(char c, Runnable action)
wait until value greater than c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenGreaterEqual(char c, Runnable action)
wait until value greater than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenLess(char c, Runnable action)
wait until value less than c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenLessEqual(char c, Runnable action)
wait until value less than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenNotEqual(char c, Runnable action)
wait until value not equal to c, then run action if nonnull.
The action is run with the synchronization lock held.