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

All Implemented Interfaces:
    Cloneable, Comparable, Executor

A class useful for offloading waiting and signalling operations on single long variables.

[ Introduction to this package. ]
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedLong:
value_
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable:
lock_
Constructor:
 public WaitableLong(long initialValue) 
 public WaitableLong(long initialValue,
    Object lock) 
    Make a new WaitableLong with the given initial value, and using the supplied lock. *
Method from EDU.oswego.cs.dl.util.concurrent.WaitableLong Summary:
add,   and,   commit,   complement,   decrement,   divide,   increment,   multiply,   or,   set,   subtract,   whenEqual,   whenGreater,   whenGreaterEqual,   whenLess,   whenLessEqual,   whenNotEqual,   xor
Methods from EDU.oswego.cs.dl.util.concurrent.SynchronizedLong:
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.WaitableLong Detail:
 public long add(long amount) 
 public long and(long b) 
    Set value to value & b.
 public boolean commit(long assumedValue,
    long newValue) 
 public long complement() 
    Set the value to its complement
 public long decrement() 
 public long divide(long factor) 
 public long increment() 
 public long multiply(long factor) 
 public long or(long b) 
    Set value to value | b.
 public long set(long newValue) 
 public long subtract(long amount) 
 public  void whenEqual(long c,
    Runnable action) throws InterruptedException 
    Wait until value equals c, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenGreater(long c,
    Runnable action) throws InterruptedException 
    wait until value greater than c, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenGreaterEqual(long c,
    Runnable action) throws InterruptedException 
    wait until value greater than or equal to c, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenLess(long c,
    Runnable action) throws InterruptedException 
    wait until value less than c, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenLessEqual(long c,
    Runnable action) throws InterruptedException 
    wait until value less than or equal to c, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenNotEqual(long c,
    Runnable action) throws InterruptedException 
    wait until value not equal to c, then run action if nonnull. The action is run with the synchronization lock held. *
 public long xor(long b) 
    Set value to value ^ b.