com.ibm.wala.util.collections
Class FifoQueueNoDuplicates<T>

java.lang.Object
  extended by com.ibm.wala.util.collections.FifoQueue<T>
      extended by com.ibm.wala.util.collections.FifoQueueNoDuplicates<T>

public class FifoQueueNoDuplicates<T>
extends FifoQueue<T>

FIFO work queue management of Objects that prevents an Object from being added to the queue if it was ever previously enqueued.


Constructor Summary
FifoQueueNoDuplicates()
           
 
Method Summary
 boolean everContained(T element)
          Indicate whether the specified element was ever in the queue.
 java.util.Iterator<T> getPushedNodes()
          Return an Iterator over the set of all the nodes that were pushed into the queue.
 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 never previously pushed into the queue.
 void push(T element)
          Insert an Object at the tail end of the queue if it was never pushed into the queue.
 java.util.Set<T> queuedSet()
          Return an iterator over all elements ever in the queue.
 
Methods inherited from class com.ibm.wala.util.collections.FifoQueue
contains, isEmpty, peek, pop, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FifoQueueNoDuplicates

public FifoQueueNoDuplicates()
Method Detail

getPushedNodes

public java.util.Iterator<T> getPushedNodes()
Return an Iterator over the set of all the nodes that were pushed into the queue.

Returns:
an Iterator over the set of pushed nodes.

push

public void push(T element)
Insert an Object at the tail end of the queue if it was never pushed into the queue.

This method determines whether an element was ever 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.

Overrides:
push in class FifoQueue<T>
Parameters:
element - is the Object to be added to the queue if not ever previously queued.

push

public 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 never previously pushed into the queue.

This method determines whether an element was ever pushed into the queue using the element's equals() method. If the element's class does not implement equals(), the default implementation assumes that two elements are equal if they are the same object.

Overrides:
push in class FifoQueue<T>
Parameters:
elements - an Iterator of Objects to be added to the queue if never already queued.

everContained

public boolean everContained(T element)
Indicate whether the specified element was ever in the queue.

Parameters:
element - determine whether this object is in the queue.
Returns:
true if element is in the queue. Otherwise false.

queuedSet

public java.util.Set<T> queuedSet()
Return an iterator over all elements ever in the queue.

Returns:
true if element is in the queue. Otherwise false.