EDU.oswego.cs.dl.util.concurrent
Class WaitableChar
- Cloneable, Comparable, Executor
public class WaitableChar
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.
|
char | add(char amount) - Add amount to value (i.e., set value += amount)
|
boolean | commit(char assumedValue, char newValue) - Set value to newValue only if it is currently assumedValue.
|
char | divide(char factor) - Divide value by factor (i.e., set value /= factor)
|
char | multiply(char factor) - Multiply value by factor (i.e., set value *= factor)
|
char | set(char newValue) - Set to newValue.
|
char | subtract(char amount) - Subtract amount from value (i.e., set value -= 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.
|
add , commit , compareTo , compareTo , compareTo , divide , equals , get , hashCode , multiply , set , subtract , swap , toString |
WaitableChar
public WaitableChar(char initialValue)
Make a new WaitableChar with the given initial value,
and using its own internal lock.
WaitableChar
public WaitableChar(char initialValue,
Object lock)
Make a new WaitableChar with the given initial value,
and using the supplied lock.
add
public char add(char amount)
Add amount to value (i.e., set value += amount)
- add in interface SynchronizedChar
commit
public boolean commit(char assumedValue,
char newValue)
Set value to newValue only if it is currently assumedValue.
- commit in interface SynchronizedChar
divide
public char divide(char factor)
Divide value by factor (i.e., set value /= factor)
- divide in interface SynchronizedChar
multiply
public char multiply(char factor)
Multiply value by factor (i.e., set value *= factor)
- multiply in interface SynchronizedChar
subtract
public char subtract(char amount)
Subtract amount from value (i.e., set value -= amount)
- subtract in interface SynchronizedChar
whenEqual
public void whenEqual(char c,
Runnable action)
throws InterruptedException
Wait until value equals c, then run action if nonnull.
The action is run with the synchronization lock held.
whenGreater
public void whenGreater(char c,
Runnable action)
throws InterruptedException
wait until value greater than c, then run action if nonnull.
The action is run with the synchronization lock held.
whenGreaterEqual
public void whenGreaterEqual(char c,
Runnable action)
throws InterruptedException
wait until value greater than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
whenLess
public void whenLess(char c,
Runnable action)
throws InterruptedException
wait until value less than c, then run action if nonnull.
The action is run with the synchronization lock held.
whenLessEqual
public void whenLessEqual(char c,
Runnable action)
throws InterruptedException
wait until value less than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
whenNotEqual
public void whenNotEqual(char c,
Runnable action)
throws InterruptedException
wait until value not equal to c, then run action if nonnull.
The action is run with the synchronization lock held.