T
- the type of the elements of the streamS
- the type of the streampublic interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
extends java.util.stream.BaseStream<T,S>
BaseStream
which wraps intermediate and terminal
operations such that they can be easily extended.
Intermediate operations will return a wrapper over the result of applying that operation to the component, such that raw references to component streams cannot escape their wrapping.
Modifier and Type | Method and Description |
---|---|
default void |
close() |
S |
decorateIntermediate(java.util.function.Function<? super S,S> transformation) |
java.util.stream.DoubleStream |
decorateIntermediateDouble(java.util.function.Function<? super S,java.util.stream.DoubleStream> transformation) |
java.util.stream.IntStream |
decorateIntermediateInt(java.util.function.Function<? super S,java.util.stream.IntStream> transformation) |
java.util.stream.LongStream |
decorateIntermediateLong(java.util.function.Function<? super S,java.util.stream.LongStream> transformation) |
<U> StreamDecorator<U> |
decorateIntermediateReference(java.util.function.Function<? super S,java.util.stream.Stream<U>> transformation) |
default <U> U |
decorateTerminal(java.util.function.Function<? super S,? extends U> termination) |
default void |
decorateVoidTerminal(java.util.function.Consumer<? super S> termination) |
S |
getComponent() |
default boolean |
isParallel() |
default java.util.Iterator<T> |
iterator() |
default S |
onClose(java.lang.Runnable closeHandler) |
default S |
parallel() |
default S |
sequential() |
default java.util.Spliterator<T> |
spliterator() |
default S |
unordered() |
S getComponent()
S decorateIntermediate(java.util.function.Function<? super S,S> transformation)
transformation
- the intermediate operation as a function on a stream<U> StreamDecorator<U> decorateIntermediateReference(java.util.function.Function<? super S,java.util.stream.Stream<U>> transformation)
U
- the type of the resulting stream elementstransformation
- the intermediate operation as a function on a streamjava.util.stream.IntStream decorateIntermediateInt(java.util.function.Function<? super S,java.util.stream.IntStream> transformation)
transformation
- the intermediate operation as a function on a streamjava.util.stream.LongStream decorateIntermediateLong(java.util.function.Function<? super S,java.util.stream.LongStream> transformation)
transformation
- the intermediate operation as a function on a streamjava.util.stream.DoubleStream decorateIntermediateDouble(java.util.function.Function<? super S,java.util.stream.DoubleStream> transformation)
transformation
- the intermediate operation as a function on a streamdefault <U> U decorateTerminal(java.util.function.Function<? super S,? extends U> termination)
U
- the type of the termination resulttermination
- the terminal operation as a function on a streamdefault void decorateVoidTerminal(java.util.function.Consumer<? super S> termination)
termination
- the terminal operation as a function on a streamdefault S sequential()
default S parallel()
default S unordered()
default S onClose(java.lang.Runnable closeHandler)
default java.util.Iterator<T> iterator()
default java.util.Spliterator<T> spliterator()
default boolean isParallel()