Class IteratorUtils<T>


  • public abstract class IteratorUtils<T>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      IteratorUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.lang.Iterable<T> concatIterators​(java.util.Iterator<T>... iterators)
      Use Stream.concat(Stream, Stream) to combine the iterators.
      static <T> java.lang.Iterable<T> concatIterators​(java.util.List<java.util.Iterator<T>> iterators)
      Use Stream.concat(Stream, Stream) to combine the iterators.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IteratorUtils

        public IteratorUtils()
    • Method Detail

      • concatIterators

        @SafeVarargs
        public static <T> java.lang.Iterable<T> concatIterators​(java.util.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> java.lang.Iterable<T> concatIterators​(java.util.List<java.util.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.