EDU.oswego.cs.dl.util.concurrent
Class WaitableDouble
public
class
WaitableDouble
extends SynchronizedDouble
Constructor Summary |
| WaitableDouble(double initialValue)
Make a new WaitableDouble with the given initial value,
and using its own internal lock.
|
| WaitableDouble(double initialValue, Object lock)
Make a new WaitableDouble with the given initial value,
and using the supplied lock.
|
Method Summary |
double | add(double amount) |
boolean | commit(double assumedValue, double newValue) |
double | divide(double factor) |
double | multiply(double factor) |
double | set(double newValue) |
double | subtract(double amount) |
void | whenEqual(double c, Runnable action)
Wait until value equals c, then run action if nonnull.
|
void | whenGreater(double c, Runnable action)
wait until value greater than c, then run action if nonnull.
|
void | whenGreaterEqual(double c, Runnable action)
wait until value greater than or equal to c, then run action if nonnull.
|
void | whenLess(double c, Runnable action)
wait until value less than c, then run action if nonnull.
|
void | whenLessEqual(double c, Runnable action)
wait until value less than or equal to c, then run action if nonnull.
|
void | whenNotEqual(double c, Runnable action)
wait until value not equal to c, then run action if nonnull.
|
public WaitableDouble(double initialValue)
Make a new WaitableDouble with the given initial value,
and using its own internal lock.
public WaitableDouble(double initialValue, Object lock)
Make a new WaitableDouble with the given initial value,
and using the supplied lock.
public double add(double amount)
public boolean commit(double assumedValue, double newValue)
public double divide(double factor)
public double multiply(double factor)
public double set(double newValue)
public double subtract(double amount)
public void whenEqual(double c, Runnable action)
Wait until value equals c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenGreater(double c, Runnable action)
wait until value greater than c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenGreaterEqual(double c, Runnable action)
wait until value greater than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenLess(double c, Runnable action)
wait until value less than c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenLessEqual(double c, Runnable action)
wait until value less than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
public void whenNotEqual(double c, Runnable action)
wait until value not equal to c, then run action if nonnull.
The action is run with the synchronization lock held.