java.util
Class Collections.UnmodifiableIterator

java.lang.Object
java.util.Collections.UnmodifiableIterator
- All Implemented Interfaces:
- Iterator
- Direct Known Subclasses:
- Collections.UnmodifiableListIterator
- Enclosing class:
- Collections
- private static class Collections.UnmodifiableIterator
- extends java.lang.Object
- implements Iterator
The implementation of the various iterator methods in the
unmodifiable classes.
|
Field Summary |
private Iterator |
i
The wrapped iterator. |
|
Method Summary |
boolean |
hasNext()
Tests whether there are still elements to be retrieved from the
underlying collection by next(). |
java.lang.Object |
next()
Obtains the next element in the underlying collection. |
void |
remove()
Blocks the removal of elements from the underlying collection by the
iterator. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
i
private final Iterator i
- The wrapped iterator.
Collections.UnmodifiableIterator
Collections.UnmodifiableIterator(Iterator i)
- Only trusted code creates a wrapper.
next
public java.lang.Object next()
- Obtains the next element in the underlying collection.
- Specified by:
next in interface Iterator
hasNext
public boolean hasNext()
- Tests whether there are still elements to be retrieved from the
underlying collection by
next(). When this method
returns true, an exception will not be thrown on calling
next().
- Specified by:
hasNext in interface Iterator
remove
public void remove()
- Blocks the removal of elements from the underlying collection by the
iterator.
- Specified by:
remove in interface Iterator