Class StreamIterable<T>
- java.lang.Object
-
- uk.gov.gchq.gaffer.commonutil.iterable.StreamIterable<T>
-
- Type Parameters:
T- the object type
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<T>
- Direct Known Subclasses:
StreamFilterIterable,StreamFlatMapIterable,StreamMapIterable,StreamTransformIterable
public class StreamIterable<T> extends Object implements Closeable, Iterable<T>
-
-
Constructor Summary
Constructors Constructor Description StreamIterable(Supplier<Stream<T>> streamSupplier)StreamIterable(StreamSupplier<T> streamSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Stream<T>getStream()Get aStreamfrom theStreamSupplier.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
-
-
-
-
Constructor Detail
-
StreamIterable
public StreamIterable(StreamSupplier<T> streamSupplier)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getStream
public Stream<T> getStream()
Get aStreamfrom theStreamSupplier.This enables the creation of multiple stream objects from the same base data, without operating on the same stream multiple times.
- Returns:
- a new
Stream
-
-