|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.common.util.VectorQueue
This class implements a standard thread-safe queue. Calling dequeue() will block the caller until something is placed in the queue by another thread. It's 1.1-compatible, but the dequeue() operation is O(n), since Vector.removeElementAt(0) has to shuffle all the remaining elements to the left.
Constructor Summary | |
VectorQueue()
Constructs a new VectorQueue |
Method Summary | |
java.lang.Object |
dequeue()
Removes an object from the front of the queue. |
void |
enqueue(java.lang.Object obj)
Puts an object at the rear of the queue. |
java.util.Vector |
getItems()
Returns the list of items in the queue. |
boolean |
isEmpty()
Returns true if the queue contains no items. |
boolean |
remove(java.lang.Object obj)
Removes an object from the queue. |
int |
size()
Returns the number of items currently in the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VectorQueue()
Method Detail |
public void enqueue(java.lang.Object obj)
obj
- any object to enqueuepublic java.lang.Object dequeue()
public boolean isEmpty()
public int size()
public java.util.Vector getItems()
public boolean remove(java.lang.Object obj)
obj
- the object to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |