|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectqueue.MyQueueIterator<E>
public class MyQueueIterator<E>
The MyQueueIterator class is an iterator for the array-based MyQueue class. See the javadocs java.util.Iterator for more details.
| Constructor Summary | |
|---|---|
MyQueueIterator()
Sets up and initializes the Iterator. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
This method runs in O(1) time. |
E |
next()
Returns the next element to view in the snapshot of the queue. |
E |
object()
Returns the object that was returned by the last call to nextObject(). |
void |
remove()
This is an optional operation from the java.util.Iterator |
void |
reset()
Puts the iterator back in its initial state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MyQueueIterator()
| Method Detail |
|---|
public boolean hasNext()
hasNext in interface Iterator<E>true if more elements exist;
false otherwise
public E next()
throws NoSuchElementException
next in interface Iterator<E>NoSuchElementException - if iterator has moved past the
last object
public E object()
throws NoSuchElementException
NoSuchElementException - when the iterator is in its
initial, before-the-first-object statepublic void reset()
public void remove()
throws UnsupportedOperationException
remove in interface Iterator<E>UnsupportedOperationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||