public class PrefetchableIterators
extends java.lang.Object
Constructor and Description |
---|
PrefetchableIterators() |
Modifier and Type | Method and Description |
---|---|
static <T> PrefetchableIterator<T> |
concat(java.util.Iterator<T>... iterators)
Concatentates the
Iterator s. |
static <T> PrefetchableIterator<T> |
concatIterators(java.util.Iterator<java.util.Iterator<T>> iterators) |
static <T> PrefetchableIterator<T> |
emptyIterator()
Returns an empty
PrefetchableIterator . |
static <T> PrefetchableIterator<T> |
fromArray(T... values)
Returns a
PrefetchableIterator over the specified values. |
public static <T> PrefetchableIterator<T> emptyIterator()
PrefetchableIterator
.public static <T> PrefetchableIterator<T> fromArray(T... values)
PrefetchableIterator
over the specified values.
PrefetchableIterator.prefetch()
is a no-op and PrefetchableIterator.isReady()
always returns true.
public static <T> PrefetchableIterator<T> concatIterators(java.util.Iterator<java.util.Iterator<T>> iterators)
public static <T> PrefetchableIterator<T> concat(java.util.Iterator<T>... iterators)
Iterator
s.
Iterable
s are first converted into a PrefetchableIterable
via maybePrefetchable(java.util.Iterator<T>)
.
The returned PrefetchableIterable
ensures that iterators which are returned
guarantee that PrefetchableIterator.isReady()
always advances till it finds an Iterable
that is not PrefetchableIterator.isReady()
. PrefetchableIterator.prefetch()
is also guaranteed to advance past empty iterators till it finds
one that is not ready.