Class IteratorUtils<T>


  • public abstract class IteratorUtils<T>
    extends Object
    • Constructor Detail

      • IteratorUtils

        public IteratorUtils()
    • Method Detail

      • concatIterators

        @SafeVarargs
        public static <T> Iterable<T> concatIterators​(Iterator<T>... iterators)
        Use 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.
        Parameters:
        iterators - a Iterator object.
      • concatIterators

        public static <T> Iterable<T> concatIterators​(List<Iterator<T>> iterators)
        Use 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.
        Parameters:
        iterators - a Iterator object.