Package com.complexible.common.collect
Class BatchingIterator<T>
- Type Parameters:
T- element type
An iterator which batches elements of the underlying iterator. This
iterator iterates over batches (iterators) of the element type. Each
returned iterator is one batch. Batches must be exhausted sequentially
to avoid interfering with each other.
-
Constructor Summary
ConstructorsConstructorDescriptionBatchingIterator(Iterator<T> sourceIterator, Predicate<T> theBatchPredicate) -
Method Summary
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peekMethods inherited from class com.google.common.collect.UnmodifiableIterator
removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
BatchingIterator
- Parameters:
sourceIterator- underlying source iterator where elements will be taken fromtheBatchPredicate- a predicate indicating whether the element should be included in the current batch
-
-
Method Details
-
computeNext
-
sized
Return aBatchingIteratorwhich creates fixed size batches.
-