EDU.oswego.cs.dl.util.concurrent
Class WaitableShort
public
class
WaitableShort
extends SynchronizedShort
Constructor Summary |
| WaitableShort(short initialValue)
Make a new WaitableShort with the given initial value,
and using its own internal lock.
|
| WaitableShort(short initialValue, Object lock)
Make a new WaitableShort with the given initial value,
and using the supplied lock.
|
Method Summary |
short | add(short amount) |
short | and(short b)
Set value to value & b. |
boolean | commit(short assumedValue, short newValue) |
short | complement()
Set the value to its complement |
short | decrement() |
short | divide(short factor) |
short | increment() |
short | multiply(short factor) |
short | or(short b)
Set value to value | b. |
short | set(short newValue) |
short | subtract(short amount) |
void | whenEqual(short c, Runnable action)
Wait until value equals c, then run action if nonnull.
|
void | whenGreater(short c, Runnable action)
wait until value greater than c, then run action if nonnull.
|
void | whenGreaterEqual(short c, Runnable action)
wait until value greater than or equal to c, then run action if nonnull.
|
void | whenLess(short c, Runnable action)
wait until value less than c, then run action if nonnull.
|
void | whenLessEqual(short c, Runnable action)
wait until value less than or equal to c, then run action if nonnull.
|
void | whenNotEqual(short c, Runnable action)
wait until value not equal to c, then run action if nonnull.
|
short | xor(short b)
Set value to value ^ b. |
public WaitableShort(short initialValue)
Make a new WaitableShort with the given initial value,
and using its own internal lock.
public WaitableShort(short initialValue, Object lock)
Make a new WaitableShort with the given initial value,
and using the supplied lock.
public short add(short amount)
public short and(short b)
Set value to value & b.
Returns: the new value
public boolean commit(short assumedValue, short newValue)
public short complement()
Set the value to its complement
Returns: the new value
public short decrement()
public short divide(short factor)
public short increment()
public short multiply(short factor)
public short or(short b)
Set value to value | b.
Returns: the new value
public short set(short newValue)
public short subtract(short amount)
public void whenEqual(short 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(short 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(short 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(short 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(short 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(short 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 short xor(short b)
Set value to value ^ b.
Returns: the new value