|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.kernel.util.UnmodifiableIterator<E>
E
- the element type.public class UnmodifiableIterator<E>
This class is used to create an iterator that cannot modify its
underlying collection.
If a method returns an UnmodifiableIterator
, it's clear that the
underlying collection cannot be modified with that iterator and that
UnsupportedOperationException
will be thrown
if remove()
is called.
Constructor Summary | |
---|---|
UnmodifiableIterator(java.util.Iterator<E> i)
Constructs a new unmodifiable iterator from the provided iterator. |
Method Summary | |
---|---|
boolean |
hasNext()
See Iterator.hasNext(). |
E |
next()
See Iterator.next(). |
void |
remove()
Throws UnsupportedOperationException . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnmodifiableIterator(java.util.Iterator<E> i)
i
- the iterator for which an unmodifiable version is created.Method Detail |
---|
public E next()
next
in interface java.util.Iterator<E>
public boolean hasNext()
hasNext
in interface java.util.Iterator<E>
public void remove()
UnsupportedOperationException
.
remove
in interface java.util.Iterator<E>
java.lang.UnsupportedOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |