|
||||||||
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.SynchronizedDouble EDU.oswego.cs.dl.util.concurrent.WaitableDouble
public class WaitableDouble
A class useful for offloading waiting and signalling operations on single double variables.
[ Introduction to this package. ]
Field Summary |
---|
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedDouble |
---|
value_ |
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable |
---|
lock_ |
Constructor Summary | |
---|---|
WaitableDouble(double initialValue)
Make a new WaitableDouble with the given initial value, and using its own internal lock. |
|
WaitableDouble(double initialValue,
java.lang.Object lock)
Make a new WaitableDouble with the given initial value, and using the supplied lock. |
Method Summary | |
---|---|
double |
add(double amount)
Add amount to value (i.e., set value += amount) |
boolean |
commit(double assumedValue,
double newValue)
Set value to newValue only if it is currently assumedValue. |
double |
divide(double factor)
Divide value by factor (i.e., set value /= factor) |
double |
multiply(double factor)
Multiply value by factor (i.e., set value *= factor) |
double |
set(double newValue)
Set to newValue. |
double |
subtract(double amount)
Subtract amount from value (i.e., set value -= amount) |
void |
whenEqual(double c,
java.lang.Runnable action)
Wait until value equals c, then run action if nonnull. |
void |
whenGreater(double c,
java.lang.Runnable action)
wait until value greater than c, then run action if nonnull. |
void |
whenGreaterEqual(double c,
java.lang.Runnable action)
wait until value greater than or equal to c, then run action if nonnull. |
void |
whenLess(double c,
java.lang.Runnable action)
wait until value less than c, then run action if nonnull. |
void |
whenLessEqual(double c,
java.lang.Runnable action)
wait until value less than or equal to c, then run action if nonnull. |
void |
whenNotEqual(double c,
java.lang.Runnable action)
wait until value not equal to c, then run action if nonnull. |
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronizedDouble |
---|
compareTo, compareTo, compareTo, equals, get, hashCode, 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 WaitableDouble(double initialValue)
public WaitableDouble(double initialValue, java.lang.Object lock)
Method Detail |
---|
public double set(double newValue)
SynchronizedDouble
set
in class SynchronizedDouble
public boolean commit(double assumedValue, double newValue)
SynchronizedDouble
commit
in class SynchronizedDouble
public double add(double amount)
SynchronizedDouble
add
in class SynchronizedDouble
public double subtract(double amount)
SynchronizedDouble
subtract
in class SynchronizedDouble
public double multiply(double factor)
SynchronizedDouble
multiply
in class SynchronizedDouble
public double divide(double factor)
SynchronizedDouble
divide
in class SynchronizedDouble
public void whenEqual(double c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenNotEqual(double c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenLessEqual(double c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenLess(double c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenGreaterEqual(double c, java.lang.Runnable action) throws java.lang.InterruptedException
java.lang.InterruptedException
public void whenGreater(double 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 |