Class IteratorConcat<T>

java.lang.Object
org.apache.jena.atlas.iterator.IteratorConcat<T>
All Implemented Interfaces:
Iterator<T>, IteratorCloseable<T>, Closeable

public class IteratorConcat<T> extends Object implements IteratorCloseable<T>
Iterator of Iterators IteratorConcat is better when there are lots of iterators to be joined. IteratorCons is slightly better for two iterators.
  • Constructor Details

    • IteratorConcat

      public IteratorConcat()
  • Method Details

    • concat

      public static <T> Iterator<T> concat(Iterator<T> iter1, Iterator<T> iter2)
      Usually, it is better to create an IteratorConcat explicitly and add iterator if there are going to be many.
      Parameters:
      iter1 -
      iter2 -
      Returns:
      Iterator
      See Also:
    • add

      public void add(Iterator<T> iter)
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
    • forEachRemaining

      public void forEachRemaining(Consumer<? super T> action)
      Specified by:
      forEachRemaining in interface Iterator<T>
    • close

      public void close()
      Specified by:
      close in interface Closeable