Class PushbackIterator<E>

java.lang.Object
org.apache.commons.collections4.iterators.PushbackIterator<E>
Type Parameters:
E - the type of elements returned by this iterator.
All Implemented Interfaces:
Iterator<E>

public class PushbackIterator<E> extends Object implements Iterator<E>
Decorates an iterator to support pushback of elements.

The decorator stores the pushed back elements in a LIFO manner: the last element that has been pushed back, will be returned as the next element in a call to next().

The decorator does not support the removal operation. Any call to remove() will result in an UnsupportedOperationException.

Since:
4.0