|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable EDU.oswego.cs.dl.util.concurrent.SynchronizedShort EDU.oswego.cs.dl.util.concurrent.WaitableShort
public class WaitableShort
A class useful for offloading waiting and signalling operations on single short variables.
[ Introduction to this package. ]
Field Summary |
---|
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedShort |
---|
value_ |
Fields inherited from class EDU.oswego.cs.dl.util.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) |
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. |
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedShort |
---|
compareTo, compareTo, compareTo, equals, get, hashCode, negate, swap, toString |
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable |
---|
execute, getLock |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WaitableShort(short initialValue)
public WaitableShort(short initialValue, java.lang.Object lock)
Method Detail |
---|
public short set(short newValue)
SynchronizedShort
set
in class SynchronizedShort
public boolean commit(short assumedValue, short newValue)
SynchronizedShort
commit
in class SynchronizedShort
public short increment()
SynchronizedShort
increment
in class SynchronizedShort
public short decrement()
SynchronizedShort
decrement
in class SynchronizedShort
public short add(short amount)
SynchronizedShort
add
in class SynchronizedShort
public short subtract(short amount)
SynchronizedShort
subtract
in class SynchronizedShort
public short multiply(short factor)
SynchronizedShort
multiply
in class SynchronizedShort
public short divide(short factor)
SynchronizedShort
divide
in class SynchronizedShort
public short complement()
complement
in class SynchronizedShort
public short and(short b)
and
in class SynchronizedShort
public short or(short b)
or
in class SynchronizedShort
public short xor(short b)
xor
in class SynchronizedShort
public void whenEqual(short c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenNotEqual(short c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenLessEqual(short c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenLess(short c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenGreaterEqual(short c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenGreater(short c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |