public class DebugDoubleStream extends Object implements DoubleStream, DebuggableStreaming<Double>
DoubleStream wrapper, which allows overriding of only
two methods to allow seeing stream operation in realtime.DoubleStream.Builder| Modifier | Constructor and Description |
|---|---|
protected |
DebugDoubleStream(DoubleStream stream,
boolean outputResults) |
protected DebugDoubleStream(DoubleStream stream, boolean outputResults)
public static DebugDoubleStream of(DoubleStream stream)
DebugDoubleStream using the default typestream - The DoubleStream to wrapDebugDoubleStream wrapper of the provided DoubleStreampublic static DebugDoubleStream of(DoubleStream stream, boolean outputResults)
DebugDoubleStream using the default typestream - The DoubleStream to wrapoutputResults - true to output the results of the DoubleStream as it is operated uponDebugDoubleStream wrapper of the provided DoubleStreampublic static DebugDoubleStream of(DoubleStream stream, Class<? extends DebugDoubleStream> type)
DebugDoubleStream of the type parameter passed to the method. This is the appropriate
way to instantiate the DebugDoubleStream, as future caching mechanisms will be in place to optimize this.
You may however expose the constructor if you so choose.stream - The DoubleStream to create a DebugDoubleStream of.type - The class representing the type of the DebugDoubleStream to instantiateDebugDoubleStream of the provided DoubleStreampublic static DebugDoubleStream of(DoubleStream stream, boolean outputResults, Class<? extends DebugDoubleStream> type)
DebugDoubleStream of the type parameter passed to the method. This is the appropriate
way to instantiate the DebugDoubleStream, as future caching mechanisms will be in place to optimize this.
You may however expose the constructor if you so choose.stream - The DoubleStream to create a DebugDoubleStream of.outputResults - true to output the results of the DoubleStream as it is operated upontype - The class representing the type of the DebugDoubleStream to instantiateDebugDoubleStream of the provided DoubleStream, or the base class instance of
DebugDoubleStream if the type either failed to instantiate or was null.protected <R> R operate(Function<? super DoubleStream,? extends R> action)
DoubleStream action, and outputs the result as well as
which numerical call it is. For example, the third #filter calll will be printed as
DebugStream#filter[2]: <result>. The output of result will be substringed to a maximum
of 50 characters, to keep the console from being spammed with large datasets. Additionally, method names with
differing method parameters will be grouped under the same aliases and therefore, the same method "counter".
DoubleStream will need to be recreated each time.R - The return type of the actionaction - The Function representing the action taken on the DoubleStreamDoubleStreamprotected void operateVoid(Consumer<? super DoubleStream> action)
DoubleStream action, and outputs the result as well as
which numerical call it is. Due to this being a void operation on a Consumer, the result output will
always be null.action - The Consumer representing the action taken on the DoubleStreamDebugStream.operate(Function)public static <D> DebugDoubleStream mapFromObject(DebuggableStreaming<D> debugStream, ToDoubleFunction<? super D> mapper)
public static <D> DebugDoubleStream flatMapFromObject(DebuggableStreaming<D> debugStream, Function<? super D,? extends DoubleStream> mapper)
public DoubleStream filter(DoublePredicate predicate)
filter in interface DoubleStreampublic DoubleStream map(DoubleUnaryOperator mapper)
map in interface DoubleStreampublic <U> Stream<U> mapToObj(DoubleFunction<? extends U> mapper)
mapToObj in interface DoubleStreampublic LongStream mapToLong(DoubleToLongFunction mapper)
mapToLong in interface DoubleStreampublic IntStream mapToInt(DoubleToIntFunction mapper)
mapToInt in interface DoubleStreampublic DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper)
flatMap in interface DoubleStreampublic DoubleStream distinct()
distinct in interface DoubleStreampublic DoubleStream sorted()
sorted in interface DoubleStreampublic DoubleStream peek(DoubleConsumer action)
peek in interface DoubleStreampublic DoubleStream limit(long maxSize)
limit in interface DoubleStreampublic DoubleStream skip(long n)
skip in interface DoubleStreampublic void forEach(DoubleConsumer action)
forEach in interface DoubleStreampublic void forEachOrdered(DoubleConsumer action)
forEachOrdered in interface DoubleStreampublic double[] toArray()
toArray in interface DoubleStreampublic double reduce(double identity,
DoubleBinaryOperator op)
reduce in interface DoubleStreampublic OptionalDouble reduce(DoubleBinaryOperator op)
reduce in interface DoubleStreampublic <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R,R> combiner)
collect in interface DoubleStreampublic double sum()
sum in interface DoubleStreampublic OptionalDouble min()
min in interface DoubleStreampublic OptionalDouble max()
max in interface DoubleStreampublic long count()
count in interface DoubleStreampublic OptionalDouble average()
average in interface DoubleStreampublic DoubleSummaryStatistics summaryStatistics()
summaryStatistics in interface DoubleStreampublic boolean anyMatch(DoublePredicate predicate)
anyMatch in interface DoubleStreampublic boolean allMatch(DoublePredicate predicate)
allMatch in interface DoubleStreampublic boolean noneMatch(DoublePredicate predicate)
noneMatch in interface DoubleStreampublic OptionalDouble findFirst()
findFirst in interface DoubleStreampublic OptionalDouble findAny()
findAny in interface DoubleStreampublic Stream<Double> boxed()
boxed in interface DoubleStreampublic DoubleStream sequential()
sequential in interface BaseStream<Double,DoubleStream>sequential in interface DoubleStreampublic DoubleStream parallel()
parallel in interface BaseStream<Double,DoubleStream>parallel in interface DoubleStreampublic DoubleStream unordered()
unordered in interface BaseStream<Double,DoubleStream>public DoubleStream onClose(Runnable closeHandler)
onClose in interface BaseStream<Double,DoubleStream>public void close()
close in interface AutoCloseableclose in interface BaseStream<Double,DoubleStream>public PrimitiveIterator.OfDouble iterator()
iterator in interface BaseStream<Double,DoubleStream>iterator in interface DoubleStreampublic Spliterator.OfDouble spliterator()
spliterator in interface BaseStream<Double,DoubleStream>spliterator in interface DoubleStreampublic boolean isParallel()
isParallel in interface BaseStream<Double,DoubleStream>public Stream<Double> getRawStream()
getRawStream in interface DebuggableStreaming<Double>public boolean isOutputtingResults()
isOutputtingResults in interface DebuggableStreaming<Double>Copyright © 2017. All rights reserved.