|
net.datastructures - version 5.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.datastructures.ElementIterator<E>
public class ElementIterator<E>
A simple iterator class for lists. The elements of a list are returned by this iterator. No copy of the list is made, so any changes to the list are reflected in the iterator.
Field Summary | |
---|---|
protected Position<E> |
cursor
|
protected PositionList<E> |
list
|
Constructor Summary | |
---|---|
ElementIterator(PositionList<E> L)
Creates an element iterator over the given list. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns whether the iterator has a next object. |
E |
next()
Returns the next object in the iterator. |
void |
remove()
Throws an UnsupportedOperationException in all cases,
because removal is not a supported operation in this iterator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PositionList<E> list
protected Position<E> cursor
Constructor Detail |
---|
public ElementIterator(PositionList<E> L)
Method Detail |
---|
public boolean hasNext()
hasNext
in interface Iterator<E>
public E next() throws NoSuchElementException
next
in interface Iterator<E>
NoSuchElementException
public void remove() throws UnsupportedOperationException
UnsupportedOperationException
in all cases,
because removal is not a supported operation in this iterator.
remove
in interface Iterator<E>
UnsupportedOperationException
|
net.datastructures - version 5.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |