| java.lang.Object EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable EDU.oswego.cs.dl.util.concurrent.SynchronizedFloat
All known Subclasses: EDU.oswego.cs.dl.util.concurrent.WaitableFloat,
Field Summary | |
protected float | value_ |
Constructor Summary | |
public | SynchronizedFloat(float initialValue) Make a new SynchronizedFloat with the given initial value,
and using its own internal lock. | public | SynchronizedFloat(float initialValue, Object lock) Make a new SynchronizedFloat with the given initial value,
and using the supplied lock. |
value_ | protected float value_(Code) | | |
SynchronizedFloat | public SynchronizedFloat(float initialValue)(Code) | | Make a new SynchronizedFloat with the given initial value,
and using its own internal lock.
|
SynchronizedFloat | public SynchronizedFloat(float initialValue, Object lock)(Code) | | Make a new SynchronizedFloat with the given initial value,
and using the supplied lock.
|
add | public float add(float amount)(Code) | | Add amount to value (i.e., set value += amount)
the new value |
commit | public boolean commit(float assumedValue, float newValue)(Code) | | Set value to newValue only if it is currently assumedValue.
true if successful |
compareTo | public int compareTo(float other)(Code) | | |
divide | public float divide(float factor)(Code) | | Divide value by factor (i.e., set value /= factor)
the new value |
get | final public float get()(Code) | | Return the current value
|
hashCode | public int hashCode()(Code) | | |
multiply | public synchronized float multiply(float factor)(Code) | | Multiply value by factor (i.e., set value *= factor)
the new value |
set | public float set(float newValue)(Code) | | Set to newValue.
the old value |
subtract | public float subtract(float amount)(Code) | | Subtract amount from value (i.e., set value -= amount)
the new value |
swap | public float swap(SynchronizedFloat other)(Code) | | Atomically swap values with another SynchronizedFloat.
Uses identityHashCode to avoid deadlock when
two SynchronizedFloats attempt to simultaneously swap with each other.
(Note: Ordering via identyHashCode is not strictly guaranteed
by the language specification to return unique, orderable
values, but in practice JVMs rely on them being unique.)
the new value |
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable | final protected Object lock_(Code)(Java Doc)
|
|
|