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

All Implemented Interfaces:
    BoundedChannel

Efficient array-based bounded buffer class. Adapted from CPJ, chapter 8, which describes design.

[ Introduction to this package. ]

Field Summary
protected final  Object[] array_     
protected  int takePtr_     
protected  int putPtr_     
protected  int usedSlots_     
protected  int emptySlots_     
protected final  Object putMonitor_    Helper monitor to handle puts. 
Constructor:
 public BoundedBuffer() 
 public BoundedBuffer(int capacity) throws IllegalArgumentException 
    Create a BoundedBuffer with the given capacity.
    Throws:
    IllegalArgumentException - if capacity less or equal to zero *
    exception: IllegalArgumentException - if capacity less or equal to zero *
Method from EDU.oswego.cs.dl.util.concurrent.BoundedBuffer Summary:
capacity,   extract,   incEmptySlots,   incUsedSlots,   insert,   offer,   peek,   poll,   put,   size,   take
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from EDU.oswego.cs.dl.util.concurrent.BoundedBuffer Detail:
 public int capacity() 
 protected final Object extract() 
 protected  void incEmptySlots() 
 protected synchronized  void incUsedSlots() 
 protected final  void insert(Object x) 
 public boolean offer(Object x,
    long msecs) throws InterruptedException 
 public Object peek() 
 public Object poll(long msecs) throws InterruptedException 
 public  void put(Object x) throws InterruptedException 
 public synchronized int size() 
    Return the number of elements in the buffer. This is only a snapshot value, that may change immediately after returning. *
 public Object take() throws InterruptedException