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

All Implemented Interfaces:
    Cloneable, Comparable, Executor

Direct Known Subclasses:
    WaitableShort

A class useful for offloading synch for short instance variables.

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