Class LazyCollectionStream<T>
java.lang.Object
java.util.Spliterators.AbstractSpliterator<T>
org.jdrupes.builder.core.LazyCollectionStream<T>
- Type Parameters:
T- the element type
- All Implemented Interfaces:
Spliterator<T>
A stream of elements whose backing collection is obtained lazily from
a supplier when the stream is first consumed.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR> -
Field Summary
Fields inherited from interface Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachRemaining(Consumer<? super T> action) static <T> Stream<T> of(Supplier<Collection<T>> supplier) Creates a stream backed by a collection supplied lazily by the given supplier.booleantryAdvance(Consumer<? super T> action) Methods inherited from class Spliterators.AbstractSpliterator
characteristics, estimateSize, trySplitMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Spliterator
getComparator, getExactSizeIfKnown, hasCharacteristics
-
Method Details
-
forEachRemaining
-
tryAdvance
-
of
Creates a stream backed by a collection supplied lazily by the given supplier. The supplier is invoked only when the stream is first consumed.- Type Parameters:
T- the element type- Parameters:
supplier- supplies the collection- Returns:
- the stream
-