- All Implemented Interfaces:
- CloseableIterator<E>, CloseableIteration<E,RuntimeException>, Iteration<E,RuntimeException>, Closeable, Iterator<E>
public abstract class DelayedIterator<E>
- extends DelayedIteration<E,RuntimeException>
- implements CloseableIterator<E>
An iterator that delays the creation of the underlying iterator until it is
being accessed. This is mainly useful for situations where iterator creation
adds considerable overhead but where the iterator may not actually be used,
or where a created iterator consumes scarce resources like JDBC-connections
or memory. Subclasses must implement the createIterator method,
which is called once when the iterator is first needed.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected final Iteration<? extends E,RuntimeException> createIteration()
- Description copied from class:
- Creates the iteration that should be iterated over. This method is called
only once, when the iteration is first needed.
- Specified by:
createIteration in class
protected abstract Iterator<? extends E> createIterator()
- Creates the iterator that should be iterated over. This method is called
only once, when the iterator is first needed.
Copyright © 1997-2008 Aduna. All Rights Reserved.