|
||||||||
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.SynchronizedByte EDU.oswego.cs.dl.util.concurrent.WaitableByte
public class WaitableByte
A class useful for offloading waiting and signalling operations on single byte variables.
[ Introduction to this package. ]
Field Summary |
---|
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedByte |
---|
value_ |
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable |
---|
lock_ |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedByte |
---|
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 WaitableByte(byte initialValue)
public WaitableByte(byte initialValue, java.lang.Object lock)
Method Detail |
---|
public byte set(byte newValue)
SynchronizedByte
set
in class SynchronizedByte
public boolean commit(byte assumedValue, byte newValue)
SynchronizedByte
commit
in class SynchronizedByte
public byte increment()
SynchronizedByte
increment
in class SynchronizedByte
public byte decrement()
SynchronizedByte
decrement
in class SynchronizedByte
public byte add(byte amount)
SynchronizedByte
add
in class SynchronizedByte
public byte subtract(byte amount)
SynchronizedByte
subtract
in class SynchronizedByte
public byte multiply(byte factor)
SynchronizedByte
multiply
in class SynchronizedByte
public byte divide(byte factor)
SynchronizedByte
divide
in class SynchronizedByte
public byte complement()
complement
in class SynchronizedByte
public byte and(byte b)
and
in class SynchronizedByte
public byte or(byte b)
or
in class SynchronizedByte
public byte xor(byte b)
xor
in class SynchronizedByte
public void whenEqual(byte c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenNotEqual(byte c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenLessEqual(byte c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenLess(byte c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenGreaterEqual(byte c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenGreater(byte 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 |