EDU.oswego.cs.dl.util.concurrent
Class WaitableByte
- Cloneable, Comparable, Executor
public class WaitableByte
WaitableByte(byte initialValue) - Make a new WaitableByte with the given initial value,
and using its own internal lock.
|
WaitableByte(byte initialValue, Object lock) - Make a new WaitableByte with the given initial value,
and using the supplied lock.
|
byte | add(byte amount)
|
boolean | commit(byte assumedValue, byte newValue)
|
byte | decrement()
|
byte | divide(byte factor)
|
byte | increment()
|
byte | multiply(byte factor)
|
byte | set(byte newValue)
|
byte | subtract(byte amount)
|
void | whenEqual(byte c, Runnable action) - Wait until value equals c, then run action if nonnull.
|
void | whenGreater(byte c, Runnable action) - wait until value greater than c, then run action if nonnull.
|
void | whenGreaterEqual(byte c, Runnable action) - wait until value greater than or equal to c, then run action if nonnull.
|
void | whenLess(byte c, Runnable action) - wait until value less than c, then run action if nonnull.
|
void | whenLessEqual(byte c, Runnable action) - wait until value less than or equal to c, then run action if nonnull.
|
void | whenNotEqual(byte c, Runnable action) - wait until value not equal to c, then run action if nonnull.
|
add , and , commit , compareTo , compareTo , compareTo , complement , decrement , divide , equals , get , hashCode , increment , multiply , negate , or , set , subtract , swap , toString , xor |
WaitableByte
public WaitableByte(byte initialValue)
Make a new WaitableByte with the given initial value,
and using its own internal lock.
WaitableByte
public WaitableByte(byte initialValue,
Object lock)
Make a new WaitableByte with the given initial value,
and using the supplied lock.
commit
public boolean commit(byte assumedValue,
byte newValue)
- commit in interface SynchronizedByte
whenEqual
public void whenEqual(byte 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(byte 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(byte 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(byte 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(byte 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(byte 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.