public class PriorityQueueIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>
| Modifier and Type | Field and Description |
|---|---|
private PriorityQueue<T> |
priorityQueue |
| Constructor and Description |
|---|
PriorityQueueIterator(PriorityQueue<T> pq)
Constructs a PriorityQueueIterator by utilizing a copy of the
PriorityQueue.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
T |
next()
Returns the next element in the iteration.
|
void |
remove()
Unsupported in this iterator for this assignment
|
private PriorityQueue<T> priorityQueue
public PriorityQueueIterator(PriorityQueue<T> pq)
pq - public boolean hasNext()
hasNext in interface java.util.Iterator<T>public T next()
next in interface java.util.Iterator<T>java.util.NoSuchElementException - if the iteration has no more elementspublic void remove()
remove in interface java.util.Iterator<T>