public class FifoQueueNoDuplicates<T> extends FifoQueue<T>
Constructor and Description |
---|
FifoQueueNoDuplicates() |
Modifier and Type | Method and Description |
---|---|
boolean |
everContained(T element)
Indicate whether the specified element was ever in the queue.
|
Iterator<T> |
getPushedNodes()
Return an Iterator over the set of all the nodes that were pushed into the
queue.
|
void |
push(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.
|
Set<T> |
queuedSet()
Return the set of objects that have been queued.
|
public Iterator<T> getPushedNodes()
public void push(T element)
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.
public void push(Iterator<? extends T> elements) throws IllegalArgumentException
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.
push
in class FifoQueue<T>
elements
- an Iterator of Objects to be added to the queue if never already
queued.IllegalArgumentException
- if elements == nullpublic boolean everContained(T element)
element
- determine whether this object is in the queue.true
if element
is in the queue.
Otherwise false
.