E
- The type of object returned by the iterator.public class UnmodifiableIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
remove
method from the Iterator
interface is not supported and
will throw an UnsupportedOperationException
if called.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT |
Constructor and Description |
---|
UnmodifiableIterator(java.util.Iterator<E> iter)
Constructor for
UnmodifiableIterator class. |
public static final java.lang.String COPYRIGHT
public UnmodifiableIterator(java.util.Iterator<E> iter)
UnmodifiableIterator
class.iter
- The Iterator
that this object is to be based on.public boolean hasNext()
hasNext
in interface java.util.Iterator<E>
public E next()
hasNext()
method returns false will return each element in the underlying
collection exactly once.next
in interface java.util.Iterator<E>
public void remove()
UnsupportedOperationException
if called.remove
in interface java.util.Iterator<E>