public class WaitableFloat extends SynchronizedFloat
value_lock_| Constructor and Description |
|---|
WaitableFloat(float initialValue)
Make a new WaitableFloat with the given initial value,
and using its own internal lock.
|
WaitableFloat(float initialValue,
java.lang.Object lock)
Make a new WaitableFloat with the given initial value,
and using the supplied lock.
|
| Modifier and Type | Method and Description |
|---|---|
float |
add(float amount)
Add amount to value (i.e., set value += amount)
|
boolean |
commit(float assumedValue,
float newValue)
Set value to newValue only if it is currently assumedValue.
|
float |
divide(float factor)
Divide value by factor (i.e., set value /= factor)
|
float |
multiply(float factor)
Multiply value by factor (i.e., set value *= factor)
|
float |
set(float newValue)
Set to newValue.
|
float |
subtract(float amount)
Subtract amount from value (i.e., set value -= amount)
|
void |
whenEqual(float c,
java.lang.Runnable action)
Wait until value equals c, then run action if nonnull.
|
void |
whenGreater(float c,
java.lang.Runnable action)
wait until value greater than c, then run action if nonnull.
|
void |
whenGreaterEqual(float c,
java.lang.Runnable action)
wait until value greater than or equal to c, then run action if nonnull.
|
void |
whenLess(float c,
java.lang.Runnable action)
wait until value less than c, then run action if nonnull.
|
void |
whenLessEqual(float c,
java.lang.Runnable action)
wait until value less than or equal to c, then run action if nonnull.
|
void |
whenNotEqual(float c,
java.lang.Runnable action)
wait until value not equal to c, then run action if nonnull.
|
compareTo, compareTo, compareTo, equals, get, hashCode, swap, toStringexecute, getLockpublic WaitableFloat(float initialValue)
public WaitableFloat(float initialValue,
java.lang.Object lock)
public float set(float newValue)
SynchronizedFloatset in class SynchronizedFloatpublic boolean commit(float assumedValue,
float newValue)
SynchronizedFloatcommit in class SynchronizedFloatpublic float add(float amount)
SynchronizedFloatadd in class SynchronizedFloatpublic float subtract(float amount)
SynchronizedFloatsubtract in class SynchronizedFloatpublic float multiply(float factor)
SynchronizedFloatmultiply in class SynchronizedFloatpublic float divide(float factor)
SynchronizedFloatdivide in class SynchronizedFloatpublic void whenEqual(float c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenNotEqual(float c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenLessEqual(float c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenLess(float c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenGreaterEqual(float c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void whenGreater(float c,
java.lang.Runnable action)
throws java.lang.InterruptedException
java.lang.InterruptedException