EDU.oswego.cs.dl.util.concurrent
public class BoundedBuffer extends Object implements BoundedChannel
[ Introduction to this package. ]
Field Summary | |
---|---|
protected Object[] | array_ |
protected int | emptySlots_ |
protected Object | putMonitor_
Helper monitor to handle puts.
|
protected int | putPtr_ |
protected int | takePtr_ |
protected int | usedSlots_ |
Constructor Summary | |
---|---|
BoundedBuffer(int capacity)
Create a BoundedBuffer with the given capacity. | |
BoundedBuffer()
Create a buffer with the current default capacity
|
Method Summary | |
---|---|
int | capacity() |
protected Object | extract() |
protected void | incEmptySlots() |
protected void | incUsedSlots() |
protected void | insert(Object x) |
boolean | offer(Object x, long msecs) |
Object | peek() |
Object | poll(long msecs) |
void | put(Object x) |
int | size()
Return the number of elements in the buffer.
|
Object | take() |
Throws: IllegalArgumentException if capacity less or equal to zero