Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.util
Class Collections.UnmodifiableIterator  view Collections.UnmodifiableIterator download Collections.UnmodifiableIterator.java

java.lang.Object
  extended byjava.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.
 
Constructor Summary
(package private) Collections.UnmodifiableIterator(Iterator i)
          Only trusted code creates a wrapper.
 
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
 

Field Detail

i

private final Iterator i
The wrapped iterator.

Constructor Detail

Collections.UnmodifiableIterator

Collections.UnmodifiableIterator(Iterator i)
Only trusted code creates a wrapper.

Method Detail

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