Class SuppliedIterable<T>
- java.lang.Object
-
- uk.gov.gchq.gaffer.commonutil.iterable.SuppliedIterable<T>
-
- Type Parameters:
T- the type of the iterable.
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<T>
public class SuppliedIterable<T> extends Object implements Closeable, Iterable<T>
A
SuppliedIterableallows aCloseableIterablethat can normally only be consumed once, be consumed multiple times. This SuppliedIterable is constructed with anIterableSupplier. When a new iterator is requested the get method is invoked on the supplier to generate a new iterable.This iterable is a
CloseableIterableso it will close the supplier's iterables when finished. However, if it is referred to as just anIterablethen theCloseableUtilwill have to be called to ensure that it is closed safely.
-
-
Constructor Summary
Constructors Constructor Description SuppliedIterable(Supplier<? extends Iterable<T>> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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
-
-