Class AbstractPrimedIterator<E>
java.lang.Object
com.globalmentor.collections.iterators.AbstractPrimedIterator<E>
- Type Parameters:
E
- The type of element returned by the iterator.
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
AbstractFilteredIterator
Abstract implementation of an iterator that lazily primes its next value.
This version does not support remove()
.
This class is not thread safe.
- Author:
- Garret Wilson
-
Constructor Details
-
AbstractPrimedIterator
public AbstractPrimedIterator()
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
primeNext
Returns the next available element for the iterator. The value returned by this method will be returned by the next call tonext
. The implementation guarantees that this method will not be called again afternull
is returned.- Returns:
- The next primed value for the iterator, or
null
if there are no further values.
-
remove
public void remove()
-