public abstract class IteratorUtils<T> extends Object
Constructor and Description |
---|
IteratorUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> Iterable<T> |
concatIterators(Iterator<T>... iterators)
Use
Stream.concat(Stream, Stream) to combine the iterators. |
static <T> Iterable<T> |
concatIterators(List<Iterator<T>> iterators)
Use
Stream.concat(Stream, Stream) to combine the iterators. |
@SafeVarargs public static <T> Iterable<T> concatIterators(Iterator<T>... iterators)
Stream.concat(Stream, Stream)
to combine the iterators.
CAUTION: The Iterable returned by this method is not reusable and does
not support Iterator.remove()
because it is backed by a Stream
.iterators
- a Iterator
object.public static <T> Iterable<T> concatIterators(List<Iterator<T>> iterators)
Stream.concat(Stream, Stream)
to combine the iterators.
CAUTION: The Iterable returned by this method is not reusable and does
not support Iterator.remove()
because it is backed by a Stream
.iterators
- a Iterator
object.Copyright © 2020. All rights reserved.