public class WaitableByte extends SynchronizedByte
value_lock_| Constructor and Description |
|---|
WaitableByte(byte initialValue)
Make a new WaitableByte with the given initial value,
and using its own internal lock.
|
WaitableByte(byte initialValue,
java.lang.Object lock)
Make a new WaitableByte with the given initial value,
and using the supplied lock.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
add(byte amount)
Add amount to value (i.e., set value += amount)
|
byte |
and(byte b)
Set value to value & b.
|
boolean |
commit(byte assumedValue,
byte newValue)
Set value to newValue only if it is currently assumedValue.
|
byte |
complement()
Set the value to its complement
|
byte |
decrement()
Decrement the value.
|
byte |
divide(byte factor)
Divide value by factor (i.e., set value /= factor)
|
byte |
increment()
Increment the value.
|
byte |
multiply(byte factor)
Multiply value by factor (i.e., set value *= factor)
|
byte |
or(byte b)
Set value to value | b.
|
byte |
set(byte newValue)
Set to newValue.
|
byte |
subtract(byte amount)
Subtract amount from value (i.e., set value -= amount)
|
void |
whenEqual(byte c,
java.lang.Runnable action)
Wait until value equals c, then run action if nonnull.
|
void |
whenGreater(byte c,
java.lang.Runnable action)
wait until value greater than c, then run action if nonnull.
|
void |
whenGreaterEqual(byte c,
java.lang.Runnable action)
wait until value greater than or equal to c, then run action if nonnull.
|
void |
whenLess(byte c,
java.lang.Runnable action)
wait until value less than c, then run action if nonnull.
|
void |
whenLessEqual(byte c,
java.lang.Runnable action)
wait until value less than or equal to c, then run action if nonnull.
|
void |
whenNotEqual(byte c,
java.lang.Runnable action)
wait until value not equal to c, then run action if nonnull.
|
byte |
xor(byte b)
Set value to value ^ b.
|
compareTo, compareTo, compareTo, equals, get, hashCode, negate, swap, toStringexecute, getLockpublic WaitableByte(byte initialValue)
public WaitableByte(byte initialValue,
java.lang.Object lock)
public byte set(byte newValue)
SynchronizedByteset in class SynchronizedBytepublic boolean commit(byte assumedValue,
byte newValue)
SynchronizedBytecommit in class SynchronizedBytepublic byte increment()
SynchronizedByteincrement in class SynchronizedBytepublic byte decrement()
SynchronizedBytedecrement in class SynchronizedBytepublic byte add(byte amount)
SynchronizedByteadd in class SynchronizedBytepublic byte subtract(byte amount)
SynchronizedBytesubtract in class SynchronizedBytepublic byte multiply(byte factor)
SynchronizedBytemultiply in class SynchronizedBytepublic byte divide(byte factor)
SynchronizedBytedivide in class SynchronizedBytepublic byte complement()
complement in class SynchronizedBytepublic byte and(byte b)
and in class SynchronizedBytepublic byte or(byte b)
or in class SynchronizedBytepublic byte xor(byte b)
xor in class SynchronizedBytepublic void whenEqual(byte c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenNotEqual(byte c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenLessEqual(byte c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenLess(byte c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenGreaterEqual(byte c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenGreater(byte c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedException