| java.lang.Object EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable EDU.oswego.cs.dl.util.concurrent.SynchronizedDouble
All known Subclasses: EDU.oswego.cs.dl.util.concurrent.WaitableDouble,
Field Summary | |
protected double | value_ |
Constructor Summary | |
public | SynchronizedDouble(double initialValue) Make a new SynchronizedDouble with the given initial value,
and using its own internal lock. | public | SynchronizedDouble(double initialValue, Object lock) Make a new SynchronizedDouble with the given initial value,
and using the supplied lock. |
value_ | protected double value_(Code) | | |
SynchronizedDouble | public SynchronizedDouble(double initialValue)(Code) | | Make a new SynchronizedDouble with the given initial value,
and using its own internal lock.
|
SynchronizedDouble | public SynchronizedDouble(double initialValue, Object lock)(Code) | | Make a new SynchronizedDouble with the given initial value,
and using the supplied lock.
|
add | public double add(double amount)(Code) | | Add amount to value (i.e., set value += amount)
the new value |
commit | public boolean commit(double assumedValue, double newValue)(Code) | | Set value to newValue only if it is currently assumedValue.
true if successful |
compareTo | public int compareTo(double other)(Code) | | |
divide | public double divide(double factor)(Code) | | Divide value by factor (i.e., set value /= factor)
the new value |
get | final public double get()(Code) | | Return the current value
|
hashCode | public int hashCode()(Code) | | |
multiply | public synchronized double multiply(double factor)(Code) | | Multiply value by factor (i.e., set value *= factor)
the new value |
set | public double set(double newValue)(Code) | | Set to newValue.
the old value |
subtract | public double subtract(double amount)(Code) | | Subtract amount from value (i.e., set value -= amount)
the new value |
swap | public double swap(SynchronizedDouble other)(Code) | | Atomically swap values with another SynchronizedDouble.
Uses identityHashCode to avoid deadlock when
two SynchronizedDoubles 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)
|
|
|