|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.upgrade.util.FixedLengthQueue
Threadsafe queue of fixed length that blocks on put when queue is full until room frees up and blocks on get when queue is empty until an element is added.
Field Summary | |
private Object[] |
elements_
|
private int |
getIndex_
|
private int |
numElements_
|
private int |
putIndex_
|
Constructor Summary | |
FixedLengthQueue(int capacity)
Create a queue with the specified maximum capacity. |
Method Summary | |
Object |
get()
Gets the next element in the queue. |
int |
getCapacity()
The largest number of elements that the queue can hold. |
int |
getCount()
The number of elements currently in the queue. |
void |
put(Object o)
Pushes a new element into the end of the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Object[] elements_
private int putIndex_
private int getIndex_
private int numElements_
Constructor Detail |
public FixedLengthQueue(int capacity) throws IllegalArgumentException
IllegalArgumentException
- if the capacity is set to zero or smallerMethod Detail |
public Object get()
public int getCapacity()
public int getCount()
public void put(Object o)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |