|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.UnmodifiableIterator
UnmodifiableIterator
is an abstract superclass to save
you the trouble of implementing the remove()
method
over and over again for those iterators which don't implement it.
The name's a bit clunky, but fits with the JDK naming in
java.util.Collections
and etc.
Constructor Summary | |
UnmodifiableIterator()
|
Method Summary | |
abstract boolean |
hasNext()
Returns true if the iteration has more elements. |
abstract Object |
next()
Returns the next element in the iteration. |
void |
remove()
Always throws an UnsupportedOperationException . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UnmodifiableIterator()
Method Detail |
public abstract boolean hasNext()
true
if the iteration has more elements.
hasNext
in interface Iterator
true
if the iterator has more elements.public abstract Object next()
next
in interface Iterator
NoSuchElementException
- iteration has no more elements.public final void remove()
UnsupportedOperationException
.
remove
in interface Iterator
UnsupportedOperationException
- always.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |