Package com.google.common.collect
Class UnmodifiableIterator<E extends @Nullable Object>
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<E>
-
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
AbstractIterator
,AbstractSequentialIterator
,UnmodifiableListIterator
@GwtCompatible public abstract class UnmodifiableIterator<E extends @Nullable Object> extends Object implements Iterator<E>
An iterator that does not supportremove()
.UnmodifiableIterator
is used primarily in conjunction with implementations ofImmutableCollection
, such asImmutableList
. You can, however, convert an existing iterator to anUnmodifiableIterator
usingIterators.unmodifiableIterator(java.util.Iterator<? extends T>)
.- Since:
- 2.0
- Author:
- Jared Levy
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UnmodifiableIterator()
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
remove()
Deprecated.Unsupported operation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next
-
-
-
-
Constructor Detail
-
UnmodifiableIterator
protected UnmodifiableIterator()
Constructor for use by subclasses.
-
-
Method Detail
-
remove
@Deprecated public final void remove()
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the underlying data unmodified.- Specified by:
remove
in interfaceIterator<E extends @Nullable Object>
- Throws:
UnsupportedOperationException
- always
-
-