Class PrefetchingIterator<T>
java.lang.Object
com.github.basking2.sdsai.itrex.iterators.ParallelIteratorIterator<T>
com.github.basking2.sdsai.itrex.iterators.PrefetchingIterator<T>
- All Implemented Interfaces:
Iterator<T>
An iterator that prefetches and caches some number of elements from another iterator.
Sometimes it is expensive for an iterator to return a value.
In these situations it is sometimes preferable to pre-fetch a few objects, and
asynchronously replenish them.
Order is preserved, so if there is a particularly slow fetch, it may stall future fetches.
This is just a kind of
ParallelIteratorIterator
that uses a single iterator.-
Constructor Summary
-
Method Summary
Methods inherited from class com.github.basking2.sdsai.itrex.iterators.ParallelIteratorIterator
hasNext, next
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
PrefetchingIterator
-