Class LazyConcatIterator<E>

java.lang.Object
org.infinispan.util.LazyConcatIterator<E>
Type Parameters:
E - element type
All Implemented Interfaces:
AutoCloseable, Iterator<E>, org.infinispan.commons.util.CloseableIterator<E>

public class LazyConcatIterator<E> extends Object implements org.infinispan.commons.util.CloseableIterator<E>
Iterator implementation that will return all entries from the first iterator. Upon completion of the first iterator the supplier will generate an additional iterator that will then be used as a source for this iterator. After the second iterator is consumed this iterator will also be completed.
  • Constructor Details

    • LazyConcatIterator

      public LazyConcatIterator(org.infinispan.commons.util.CloseableIterator<E> first, Supplier<? extends org.infinispan.commons.util.CloseableIterator<E>> supplier)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.infinispan.commons.util.CloseableIterator<E>
    • hasNext

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

      public E next()
      Specified by:
      next in interface Iterator<E>