|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.util.collections.FifoQueue<T>
public class FifoQueue<T>
FIFO work queue management of Objects that prevents an object from being added to the queue if it is already enqueued and has not yet been popped.
| Constructor Summary | |
|---|---|
FifoQueue()
Creates a FIFO queue with no elements enqueued. |
|
FifoQueue(java.util.Collection<T> collection)
Creates a new FIFO queue containing the elements of the specified Collection. |
|
FifoQueue(T element)
Creates a new FIFO queue containing the argument to this constructor. |
|
| Method Summary | |
|---|---|
boolean |
contains(T element)
Indicate whether the specified element is currently in the queue. |
boolean |
isEmpty()
Returns whether or not this queue is empty (no enqueued elements). |
T |
peek()
Returns the next Object in the queue, but leaves it in the queue. |
T |
pop()
Remove the next Object from the queue and return it to the caller. |
void |
push(java.util.Iterator<? extends T> elements)
Insert all of the elements in the specified Iterator at the tail end of the queue if not already present in the queue. |
void |
push(T element)
Insert an Object at the tail end of the queue if it is not already in the queue. |
int |
size()
Return the current number of enqueued Objects, the number of Objects that were pushed into the queue and have not been popped. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FifoQueue()
public FifoQueue(T element)
element - is the element to add to the queue.public FifoQueue(java.util.Collection<T> collection)
collection - is the Collection of Object instances to be enqueue.
java.lang.IllegalArgumentException - if collection is null| Method Detail |
|---|
public int size()
isEmpty()public boolean isEmpty()
true when there are no enqueued objects.
false if there are objects remaining in the queue.size()public boolean contains(T element)
element - determine whether this object is in the queue.
true if element is in the queue.
Otherwise false if not currently in the queue.public void push(T element)
This method determines whether an element is already in the queue using the
element's equals() method. If the element's class does not
implement equals(), the default implementation assumes they
are equal only if it is the same object.
element - is the Object to be added to the queue if not already present in
the queue.
public void push(java.util.Iterator<? extends T> elements)
throws java.lang.IllegalArgumentException
This method determines whether an element is already in the queue using the
element's equals() method. If the element's class does not
implement equals(), the default implementation assumes they
are equal if it is the same object.
elements - an Iterator of Objects to be added to the queue if not already
queued.
java.lang.IllegalArgumentException - if elements == null
public T pop()
throws java.lang.IllegalStateException
IllegalStateException if the queue is empty when this method
is called.
java.lang.IllegalStateException
public T peek()
throws java.lang.IllegalStateException
IllegalStateException if the queue is empty when this method
is called.
java.lang.IllegalStateException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||