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

All Implemented Interfaces:
    Cloneable, Comparable, Executor

Direct Known Subclasses:
    WaitableChar

A class useful for offloading synch for char instance variables.

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