Top Description Constructors Methods
com.google.common.collect

public abstract Class UnmodifiableIterator<E extends @Nullable Object>

extends Object
implements Iterator<E extends @Nullable Object>
Class Inheritance
All Implemented Interfaces
java.util.Iterator
Known Direct Subclasses
com.google.common.collect.UnmodifiableListIterator, com.google.common.collect.AbstractIterator, com.google.common.collect.AbstractSequentialIterator, com.google.common.collect.Iterators.MergingIterator, com.google.common.collect.TreeTraverser.PreOrderIterator, com.google.common.collect.TreeTraverser.BreadthFirstIterator
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, com.google.errorprone.annotations.DoNotCall, java.util.Iterator, org.checkerframework.checker.nullness.qual.Nullable

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.

Author
Jared Levy
Since
2.0

Constructor Summary

AccessConstructor and Description
protected
UnmodifiableIterator()

Constructor for use by subclasses.

Method Summary

Modifier and TypeMethod and Description
public final void
remove()

Overrides default java.util.Iterator.remove.

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the underlying data unmodified.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnmodifiableIteratorback to summary
protected UnmodifiableIterator()

Constructor for use by subclasses.

Method Detail

removeback to summary
public final void remove()

Overrides default java.util.Iterator.remove.

Deprecated

Unsupported operation.

Guaranteed to throw an exception and leave the underlying data unmodified.

Annotations
@Deprecated
@Override
@DoNotCall:Always throws UnsupportedOperationException
Exceptions
UnsupportedOperationException:
always