EDU.oswego.cs.dl.util.concurrent
public class SynchronizedFloat extends SynchronizedVariable implements Comparable, Cloneable
Field Summary | |
---|---|
protected float | value_ |
Constructor Summary | |
---|---|
SynchronizedFloat(float initialValue)
Make a new SynchronizedFloat with the given initial value,
and using its own internal lock.
| |
SynchronizedFloat(float initialValue, Object lock)
Make a new SynchronizedFloat with the given initial value,
and using the supplied lock.
|
Method Summary | |
---|---|
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. |
int | compareTo(float other) |
int | compareTo(SynchronizedFloat other) |
int | compareTo(Object other) |
float | divide(float factor)
Divide value by factor (i.e., set value /= factor) |
boolean | equals(Object other) |
float | get()
Return the current value
|
int | hashCode() |
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) |
float | swap(SynchronizedFloat other)
Atomically swap values with another SynchronizedFloat.
|
String | toString() |
Returns: the new value
Returns: true if successful
Returns: the new value
Returns: the new value
Returns: the old value
Returns: the new value
Returns: the new value