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 void
close()
Stream<T>
getStream()
Get aStream
from 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getStream
public Stream<T> getStream()
Get aStream
from 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
-
-