info.aduna.collections.iterators
Class DelayedIterator<E>
java.lang.Object
info.aduna.iteration.CloseableIterationBase<E,X>
info.aduna.iteration.DelayedIteration<E,RuntimeException>
info.aduna.collections.iterators.DelayedIterator<E>
- 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 |
DelayedIterator
public DelayedIterator()
createIteration
protected final Iteration<? extends E,RuntimeException> createIteration()
throws RuntimeException
- Description copied from class:
DelayedIteration
- 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 DelayedIteration<E,RuntimeException>
- Throws:
RuntimeException
createIterator
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.