public class Iterators
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Iterators.FilteredIterator<T>
Creates an iterator that only returns items of a base iterator that pass
a filter.
|
static class |
Iterators.IteratorIterator<T>
Wraps a two-level iteration scenario in an iterator.
|
static class |
Iterators.Transform<S,T>
WraTps a base iterator with a transformation function.
|
static class |
Iterators.TransformingIterator<I,O> |
Modifier and Type | Method and Description |
---|---|
static <T> java.lang.Iterable<T> |
able(java.util.Iterator<T> it)
Wraps an iterator as an iterable
|
static <T> java.util.Iterator<T> |
concat(java.lang.Iterable<java.util.Iterator<? extends T>> args) |
static <T> java.lang.Iterable<T> |
concat(java.lang.Iterable<T> a,
java.lang.Iterable<T> b) |
static <T> java.util.Iterator<T> |
concat(java.util.Iterator<? extends T>... args) |
static java.util.Iterator |
emptyIterator() |
static <T> java.util.List<T> |
fillList(java.util.Iterator<? extends T> it) |
static <T> void |
fillList(java.util.Iterator<? extends T> it,
java.util.List<T> lst) |
static <T> java.util.Iterator<T> |
filter(java.util.Iterator<T> iterator,
Filter<T> filter) |
static <T> java.util.Iterator<T> |
maxLengthIterator(java.util.Iterator<T> base,
int max)
Provides a max number of elements for an underlying base iterator.
|
static <T> java.lang.Iterable<T> |
newIterable(java.util.Iterator<T> it)
Wraps an iterator as an iterable
|
static <T> java.util.List<T> |
nextList(java.util.List<java.util.Iterator<T>> iterators) |
static java.util.Iterator<java.lang.Object> |
objectIterator(java.io.ObjectInputStream instream) |
static <U> java.util.Iterator<U> |
oneItemIterator(U item) |
static <T> java.util.Iterator<T> |
thread(java.util.Iterator<T> base)
Executes calls to next() in a different thread
|
static <S,T> java.util.Iterator<Pair<S,T>> |
zip(java.util.Iterator<S> s,
java.util.Iterator<T> t) |
public static <T> void fillList(java.util.Iterator<? extends T> it, java.util.List<T> lst)
public static <T> java.util.List<T> fillList(java.util.Iterator<? extends T> it)
public static <T> java.lang.Iterable<T> newIterable(java.util.Iterator<T> it)
T
- it
- public static <T> java.lang.Iterable<T> able(java.util.Iterator<T> it)
T
- it
- public static <T> java.util.Iterator<T> thread(java.util.Iterator<T> base)
T
- base
- numThreads
- public static <S,T> java.util.Iterator<Pair<S,T>> zip(java.util.Iterator<S> s, java.util.Iterator<T> t)
public static <T> java.util.Iterator<T> maxLengthIterator(java.util.Iterator<T> base, int max)
public static <T> java.util.Iterator<T> filter(java.util.Iterator<T> iterator, Filter<T> filter)
public static <T> java.util.Iterator<T> concat(java.lang.Iterable<java.util.Iterator<? extends T>> args)
public static <T> java.util.Iterator<T> concat(java.util.Iterator<? extends T>... args)
public static <U> java.util.Iterator<U> oneItemIterator(U item)
public static java.util.Iterator emptyIterator()
public static <T> java.lang.Iterable<T> concat(java.lang.Iterable<T> a, java.lang.Iterable<T> b)
public static <T> java.util.List<T> nextList(java.util.List<java.util.Iterator<T>> iterators)
public static java.util.Iterator<java.lang.Object> objectIterator(java.io.ObjectInputStream instream)