Package com.google.common.collect
Class UnmodifiableIterator<E>
java.lang.Object
com.google.common.collect.UnmodifiableIterator<E>
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
AbstractIterator,AbstractSequentialIterator,Iterators.MergingIterator,TreeTraverser.BreadthFirstIterator,TreeTraverser.PreOrderIterator,UnmodifiableListIterator
An iterator that does not support
remove().
UnmodifiableIterator is used primarily in conjunction with implementations of ImmutableCollection, such as ImmutableList. You can, however, convert an existing
iterator to an UnmodifiableIterator using Iterators.unmodifiableIterator(java.util.Iterator<? extends T>).
- Since:
- 2.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for use by subclasses. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next
-
Constructor Details
-
UnmodifiableIterator
protected UnmodifiableIterator()Constructor for use by subclasses.
-
-
Method Details
-
remove
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the underlying data unmodified.- Specified by:
removein interfaceIterator<E>- Throws:
UnsupportedOperationException- always
-