EDU.oswego.cs.dl.util.concurrent
Class WaitableDouble
- Cloneable, Comparable, Executor
public class WaitableDouble
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.
|
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, 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.
|
add , commit , compareTo , compareTo , compareTo , divide , equals , get , hashCode , multiply , set , subtract , swap , toString |
WaitableDouble
public WaitableDouble(double initialValue)
Make a new WaitableDouble with the given initial value,
and using its own internal lock.
WaitableDouble
public WaitableDouble(double initialValue,
Object lock)
Make a new WaitableDouble with the given initial value,
and using the supplied lock.
add
public double add(double amount)
Add amount to value (i.e., set value += amount)
- add in interface SynchronizedDouble
commit
public boolean commit(double assumedValue,
double newValue)
Set value to newValue only if it is currently assumedValue.
- commit in interface SynchronizedDouble
divide
public double divide(double factor)
Divide value by factor (i.e., set value /= factor)
- divide in interface SynchronizedDouble
multiply
public double multiply(double factor)
Multiply value by factor (i.e., set value *= factor)
- multiply in interface SynchronizedDouble
subtract
public double subtract(double amount)
Subtract amount from value (i.e., set value -= amount)
- subtract in interface SynchronizedDouble
whenEqual
public void whenEqual(double c,
Runnable action)
throws InterruptedException
Wait until value equals c, then run action if nonnull.
The action is run with the synchronization lock held.
whenGreater
public void whenGreater(double c,
Runnable action)
throws InterruptedException
wait until value greater than c, then run action if nonnull.
The action is run with the synchronization lock held.
whenGreaterEqual
public void whenGreaterEqual(double c,
Runnable action)
throws InterruptedException
wait until value greater than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
whenLess
public void whenLess(double c,
Runnable action)
throws InterruptedException
wait until value less than c, then run action if nonnull.
The action is run with the synchronization lock held.
whenLessEqual
public void whenLessEqual(double c,
Runnable action)
throws InterruptedException
wait until value less than or equal to c, then run action if nonnull.
The action is run with the synchronization lock held.
whenNotEqual
public void whenNotEqual(double c,
Runnable action)
throws InterruptedException
wait until value not equal to c, then run action if nonnull.
The action is run with the synchronization lock held.