public class Iterators extends 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> Iterable<T> |
able(Iterator<T> it)
Wraps an iterator as an iterable
|
static <T> Iterator<T> |
concat(Iterable<Iterator<? extends T>> args) |
static <T> Iterable<T> |
concat(Iterable<T> a,
Iterable<T> b) |
static <T> Iterator<T> |
concat(Iterator<? extends T>... args) |
static Iterator |
emptyIterator() |
static <T> List<T> |
fillList(Iterator<? extends T> it) |
static <T> void |
fillList(Iterator<? extends T> it,
List<T> lst) |
static <T> Iterator<T> |
filter(Iterator<T> iterator,
Filter<T> filter) |
static <T> Iterator<T> |
maxLengthIterator(Iterator<T> base,
int max)
Provides a max number of elements for an underlying base iterator.
|
static <T> Iterable<T> |
newIterable(Iterator<T> it)
Wraps an iterator as an iterable
|
static <T> List<T> |
nextList(List<Iterator<T>> iterators) |
static Iterator<Object> |
objectIterator(ObjectInputStream instream) |
static <U> Iterator<U> |
oneItemIterator(U item) |
static <T> Iterator<T> |
thread(Iterator<T> base)
Executes calls to next() in a different thread
|
static <S,T> Iterator<Pair<S,T>> |
zip(Iterator<S> s,
Iterator<T> t) |
public static <T> Iterable<T> newIterable(Iterator<T> it)
T
- it
- public static <T> Iterable<T> able(Iterator<T> it)
T
- it
- public static <T> Iterator<T> thread(Iterator<T> base)
T
- base
- numThreads
- public static <T> Iterator<T> maxLengthIterator(Iterator<T> base, int max)
public static <U> Iterator<U> oneItemIterator(U item)
public static Iterator emptyIterator()
public static Iterator<Object> objectIterator(ObjectInputStream instream)
Copyright © 2016. All Rights Reserved.