Class BatchedIterable<T>
- java.lang.Object
-
- uk.gov.gchq.gaffer.commonutil.iterable.BatchedIterable<T>
-
- Type Parameters:
T
- the type of items in the iterable.
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<T>
public abstract class BatchedIterable<T> extends Object implements Closeable, Iterable<T>
ABatchedIterable
is aCloseable
Iterable
of batches. To use, extend this class and implement the createBatch method. When you have no more batches of items left, return null.As a client iterators round this iterable it will first create a batch, then iterate around the batch. When there are no more items in the batch createBatch will be called again. This should only be used in a single thread and only 1 iterator can be used at a time.
-
-
Constructor Summary
Constructors Constructor Description BatchedIterable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Iterator<T>
iterator()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-