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

All Implemented Interfaces:
    Cloneable, Comparable, Executor

Direct Known Subclasses:
    WaitableFloat

A class useful for offloading synch for float instance variables.

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