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