|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pushtotest.tool.util.Queue
public class Queue
A Thread-safe Queue implementation. This is a (hopefully) Thread-safe FIFO Queue that is backed by a Vector. It should allow the standard functionality of a queue without requiring the user to worry about the details of thread safety. This should be a monitor, so if you try to pop() or peek() on an empty queue, then the thread will wait until the queue has an object to get.
| Field Summary | |
|---|---|
protected java.util.List |
container
|
| Constructor Summary | |
|---|---|
Queue()
Creates a new Queue with the default capacity. |
|
Queue(java.util.Collection collection)
Creates a new queue with the initial queue elements set to the objects in the collection passed in. |
|
Queue(int capacity)
Creates a new Queue with the initial capacity passed in. |
|
| Method Summary | |
|---|---|
int |
contains(java.lang.Object inObject)
Call this method to find out where a specific object is in the Queue. |
void |
flush()
Removes all of the Queued objects so that the size will be 0. |
boolean |
isEmpty()
Tests whether or not this Queue has any Objects in it or not. |
java.lang.Object |
peek()
Return the next Object in the Queue, but don't remove it. |
java.lang.Object |
pop()
Return the next item in the Queue and remove it from the Queue. |
void |
push(java.lang.Object inObject)
Put this new Object in the Queue. |
int |
size()
Tells how Objects are in the Queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List container
| Constructor Detail |
|---|
public Queue()
public Queue(int capacity)
throws java.lang.IllegalArgumentException
capacity - The initial capacity for the Queu.
java.lang.IllegalArgumentException - If the capacity is a negative number.public Queue(java.util.Collection collection)
collection - The collection to start this queue with.
java.lang.NullPointerException - DOCUMENT ME!| Method Detail |
|---|
public java.lang.Object pop()
public java.lang.Object peek()
public void push(java.lang.Object inObject)
inObject - The Object to put into the Queue
java.lang.NullPointerException - DOCUMENT ME!public int size()
public boolean isEmpty()
public int contains(java.lang.Object inObject)
inObject - The Object that you want to find in the Queue.
public void flush()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||