T
- the type of the elements of the streamS
- the type of the streampublic abstract class ResourceStream<T,S extends java.util.stream.BaseStream<T,S>> extends java.lang.Object implements BaseStreamDecorator<T,S>
Modifier and Type | Class and Description |
---|---|
protected static class |
ResourceStream.DoubleResourceStream |
protected static class |
ResourceStream.IntResourceStream |
protected static class |
ResourceStream.LongResourceStream |
protected static class |
ResourceStream.ReferenceResourceStream<T> |
Modifier | Constructor and Description |
---|---|
protected |
ResourceStream(S component,
java.lang.Runnable openResource,
java.lang.Runnable closeResource) |
Modifier and Type | Method and Description |
---|---|
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) |
<U> U |
decorateTerminal(java.util.function.Function<? super S,? extends U> transformation) |
void |
decorateVoidTerminal(java.util.function.Consumer<? super S> transformation) |
S |
getComponent() |
static java.util.stream.DoubleStream |
over(java.util.stream.DoubleStream stream,
java.lang.Runnable openResource,
java.lang.Runnable closeResource) |
static java.util.stream.IntStream |
over(java.util.stream.IntStream stream,
java.lang.Runnable openResource,
java.lang.Runnable closeResource) |
static java.util.stream.LongStream |
over(java.util.stream.LongStream stream,
java.lang.Runnable openResource,
java.lang.Runnable closeResource) |
static <U> StreamDecorator<U> |
over(java.util.stream.Stream<U> stream,
java.lang.Runnable openResource,
java.lang.Runnable closeResource) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, decorateIntermediate, isParallel, iterator, onClose, parallel, sequential, spliterator, unordered
protected ResourceStream(S component, java.lang.Runnable openResource, java.lang.Runnable closeResource)
public static <U> StreamDecorator<U> over(java.util.stream.Stream<U> stream, java.lang.Runnable openResource, java.lang.Runnable closeResource)
U
- the type of the elements of the streamstream
- a reference stream over the given resource strategyopenResource
- the strategy to open the resourcecloseResource
- the strategy to close the resourceResourceStream
over the given
streampublic static java.util.stream.IntStream over(java.util.stream.IntStream stream, java.lang.Runnable openResource, java.lang.Runnable closeResource)
stream
- an integer stream over the given resource strategyopenResource
- the strategy to open the resourcecloseResource
- the strategy to close the resourceResourceStream
over the given
streampublic static java.util.stream.LongStream over(java.util.stream.LongStream stream, java.lang.Runnable openResource, java.lang.Runnable closeResource)
stream
- a long stream over the given resource strategyopenResource
- the strategy to open the resourcecloseResource
- the strategy to close the resourceResourceStream
over the given
streampublic static java.util.stream.DoubleStream over(java.util.stream.DoubleStream stream, java.lang.Runnable openResource, java.lang.Runnable closeResource)
stream
- a double stream over the given resource strategyopenResource
- the strategy to open the resourcecloseResource
- the strategy to close the resourceResourceStream
over the given
streampublic S getComponent()
getComponent
in interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
public <U> StreamDecorator<U> decorateIntermediateReference(java.util.function.Function<? super S,java.util.stream.Stream<U>> transformation)
decorateIntermediateReference
in interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
U
- the type of the resulting stream elementstransformation
- the intermediate operation as a function on a streampublic java.util.stream.IntStream decorateIntermediateInt(java.util.function.Function<? super S,java.util.stream.IntStream> transformation)
decorateIntermediateInt
in interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
transformation
- the intermediate operation as a function on a streampublic java.util.stream.LongStream decorateIntermediateLong(java.util.function.Function<? super S,java.util.stream.LongStream> transformation)
decorateIntermediateLong
in interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
transformation
- the intermediate operation as a function on a streampublic java.util.stream.DoubleStream decorateIntermediateDouble(java.util.function.Function<? super S,java.util.stream.DoubleStream> transformation)
decorateIntermediateDouble
in interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
transformation
- the intermediate operation as a function on a streampublic <U> U decorateTerminal(java.util.function.Function<? super S,? extends U> transformation)
decorateTerminal
in interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
U
- the type of the termination resulttransformation
- the terminal operation as a function on a streampublic void decorateVoidTerminal(java.util.function.Consumer<? super S> transformation)
decorateVoidTerminal
in interface BaseStreamDecorator<T,S extends java.util.stream.BaseStream<T,S>>
transformation
- the terminal operation as a function on a stream