|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.collection.base.ReadOnlyIterator<E>
E - is the templated type of the elements to iterate.public class ReadOnlyIterator<E>
This is an implementation of the Iterator interface that
gives a read-only view on an existing Iterator instance.
The design of the JDK sucks: if only Iterator would extend
Enumeration the world could be so simple.
| Field Summary | |
|---|---|
private Iterator<E> |
delegate
the actual iterator instance |
| Constructor Summary | |
|---|---|
ReadOnlyIterator(Iterator<E> iterator)
The constructor. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
|
E |
next()
|
void |
remove()
This method will always throw an exception. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Iterator<E> delegate
| Constructor Detail |
|---|
public ReadOnlyIterator(Iterator<E> iterator)
iterator - is the Iterator to adapt.| Method Detail |
|---|
public boolean hasNext()
hasNext in interface Iterator<E>public E next()
next in interface Iterator<E>
public void remove()
throws UnsupportedOperationException
remove in interface Iterator<E>UnsupportedOperationException - whenever this method is called.Iterator.remove()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||