Home » concurrent-sources » EDU.oswego.cs.dl.util.concurrent » [javadoc | source]
EDU.oswego.cs.dl.util.concurrent
public class: SynchronizedDouble [javadoc | source]
java.lang.Object
   EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable
      EDU.oswego.cs.dl.util.concurrent.SynchronizedDouble

All Implemented Interfaces:
    Cloneable, Comparable, Executor

Direct Known Subclasses:
    WaitableDouble

A class useful for offloading synch for double instance variables.

[ Introduction to this package. ]
Field Summary
protected  double value_     
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable:
lock_
Constructor:
 public SynchronizedDouble(double initialValue) 
 public SynchronizedDouble(double initialValue,
    Object lock) 
    Make a new SynchronizedDouble with the given initial value, and using the supplied lock. *
Method from EDU.oswego.cs.dl.util.concurrent.SynchronizedDouble Summary:
add,   commit,   compareTo,   compareTo,   compareTo,   divide,   equals,   get,   hashCode,   multiply,   set,   subtract,   swap,   toString
Methods from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable:
execute,   getLock
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from EDU.oswego.cs.dl.util.concurrent.SynchronizedDouble Detail:
 public double add(double amount) 
    Add amount to value (i.e., set value += amount)
 public boolean commit(double assumedValue,
    double newValue) 
    Set value to newValue only if it is currently assumedValue.
 public int compareTo(double other) 
 public int compareTo(SynchronizedDouble other) 
 public int compareTo(Object other) 
 public double divide(double factor) 
    Divide value by factor (i.e., set value /= factor)
 public boolean equals(Object other) 
 public final double get() 
    Return the current value
 public int hashCode() 
 public double multiply(double factor) 
    Multiply value by factor (i.e., set value *= factor)
 public double set(double newValue) 
    Set to newValue.
 public double subtract(double amount) 
    Subtract amount from value (i.e., set value -= amount)
 public double swap(SynchronizedDouble other) 
    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.)
 public String toString()