public final class Iterators extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Iterable<T> |
composite(Iterable<T>... iterables)
Creates an iterable which returns a composite iterator over all iterators
of the given iterables.
|
static <T> ElementIterator<T> |
composite(Iterator<T>... iterators)
Creates an iterator which subsequently iterates over all given iterators.
|
static <T> Iterable<T> |
iterableOf(Iterator<T> it)
Wraps the given Iterator into an Iterable.
|
static <T> Iterator<T> |
singleIterator(T t)
Creates an Iterator over the single given element.
|
public static <T> Iterator<T> singleIterator(T t)
t - The element.public static <T> Iterable<T> iterableOf(Iterator<T> it)
it - The Iterator to wrap.Iterable which returns the given Iterator.@SafeVarargs public static <T> ElementIterator<T> composite(Iterator<T>... iterators)
iterators - An array of iterators.@SafeVarargs public static <T> Iterable<T> composite(Iterable<T>... iterables)
iterables - The Iterables to wrap.Copyright © 2014–2015. All rights reserved.