Package org.infinispan.commons.util
Class ConcatIterator<E>
java.lang.Object
org.infinispan.commons.util.AbstractIterator<E>
org.infinispan.commons.util.ConcatIterator<E>
- All Implemented Interfaces:
AutoCloseable,Iterator<E>,CloseableIterator<E>
Iterator that concatenates a bunch of iterables into 1 big iterator. Each iterable is retrieved lazily as requested.
Note that if any of the produced iterators from the iterable implement
CloseableIterator they will be closed
when iterated upon fully or the last used iterator will be close when this iterator this closed.
Removal is implemented and will invoke remove on the last used iterator
- Since:
- 9.3
- Author:
- wburns
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.infinispan.commons.util.AbstractIterator
forEachRemaining, hasNext, nextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next
-
Constructor Details
-
ConcatIterator
-
-
Method Details
-
getNext
Description copied from class:AbstractIteratorMethod to implement to provide an iterator implementation. When this method returns null, the iterator is complete.- Specified by:
getNextin classAbstractIterator<E>- Returns:
- the next value for the iterator to return or null for it to be complete.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableIterator<E>
-
remove
public void remove()
-