|
|||||||||
| Home >> All >> org >> ematgine >> utils >> [ concurrent overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.ematgine.utils.concurrent
Class WaitableShort

java.lang.Objectorg.ematgine.utils.concurrent.SynchronizedVariable
org.ematgine.utils.concurrent.SynchronizedShort
org.ematgine.utils.concurrent.WaitableShort
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Comparable, Executor
- public class WaitableShort
- extends SynchronizedShort
A class useful for offloading waiting and signalling operations on single short variables.
[ Introduction to this package. ]
| Field Summary |
| Fields inherited from class org.ematgine.utils.concurrent.SynchronizedShort |
value_ |
| Fields inherited from class org.ematgine.utils.concurrent.SynchronizedVariable |
lock_ |
| Constructor Summary | |
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. |
|
| Method Summary | |
short |
add(short amount)
Add amount to value (i.e., set value += amount) |
boolean |
commit(short assumedValue,
short newValue)
Set value to newValue only if it is currently assumedValue. |
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 |
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. |
| Methods inherited from class org.ematgine.utils.concurrent.SynchronizedShort |
and, compareTo, compareTo, compareTo, complement, equals, get, hashCode, negate, or, swap, toString, xor |
| Methods inherited from class org.ematgine.utils.concurrent.SynchronizedVariable |
execute, getLock |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
WaitableShort
public WaitableShort(short initialValue)
- Make a new WaitableShort with the given initial value,
and using its own internal lock.
WaitableShort
public WaitableShort(short initialValue,
java.lang.Object lock)
- Make a new WaitableShort with the given initial value,
and using the supplied lock.
| Method Detail |
set
public short set(short newValue)
- Description copied from class:
SynchronizedShort - Set to newValue.
- Overrides:
setin classSynchronizedShort
commit
public boolean commit(short assumedValue,
short newValue)
- Description copied from class:
SynchronizedShort - Set value to newValue only if it is currently assumedValue.
- Overrides:
commitin classSynchronizedShort
increment
public short increment()
- Description copied from class:
SynchronizedShort - Increment the value.
- Overrides:
incrementin classSynchronizedShort
decrement
public short decrement()
- Description copied from class:
SynchronizedShort - Decrement the value.
- Overrides:
decrementin classSynchronizedShort
add
public short add(short amount)
- Description copied from class:
SynchronizedShort - Add amount to value (i.e., set value += amount)
- Overrides:
addin classSynchronizedShort
subtract
public short subtract(short amount)
- Description copied from class:
SynchronizedShort - Subtract amount from value (i.e., set value -= amount)
- Overrides:
subtractin classSynchronizedShort
multiply
public short multiply(short factor)
- Description copied from class:
SynchronizedShort - Multiply value by factor (i.e., set value *= factor)
- Overrides:
multiplyin classSynchronizedShort
divide
public short divide(short factor)
- Description copied from class:
SynchronizedShort - Divide value by factor (i.e., set value /= factor)
- Overrides:
dividein classSynchronizedShort
whenEqual
public void whenEqual(short c,
java.lang.Runnable action)
throws java.lang.InterruptedException
- Wait until value equals c, then run action if nonnull.
The action is run with the synchronization lock held.
whenNotEqual
public void whenNotEqual(short c,
java.lang.Runnable action)
throws java.lang.InterruptedException
- wait until value not equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
whenLessEqual
public void whenLessEqual(short c,
java.lang.Runnable action)
throws java.lang.InterruptedException
- wait until value less than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
whenLess
public void whenLess(short c,
java.lang.Runnable action)
throws java.lang.InterruptedException
- wait until value less than c, then run action if nonnull.
The action is run with the synchronization lock held.
whenGreaterEqual
public void whenGreaterEqual(short c,
java.lang.Runnable action)
throws java.lang.InterruptedException
- wait until value greater than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
whenGreater
public void whenGreater(short c,
java.lang.Runnable action)
throws java.lang.InterruptedException
- wait until value greater than c, then run action if nonnull.
The action is run with the synchronization lock held.
|
|||||||||
| Home >> All >> org >> ematgine >> utils >> [ concurrent overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC