Class StreamableCollection<T>
Object
StreamableCollection<T>
- Type Parameters:
T
- element-type in stream
As a stream can only be used once, this data-structure allows for repeatedly getting streams from
a collection.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionStreamableCollection
(Collection<T> collection) Create for a particular collectionStreamableCollection
(Supplier<Stream<T>> supplier) Creates a newStreamableCollection
instance. -
Method Summary
-
Constructor Details
-
StreamableCollection
Create for a particular collection- Parameters:
collection
- the collection
-
StreamableCollection
Creates a newStreamableCollection
instance.- Parameters:
supplier
- Supplies a stream of elements.
-
-
Method Details
-
stream
A single instance of the stream from the supplier.- Returns:
- an instance of the stream via a call to
Supplier.get()
forsupplier
.
-