public class DebugLongStream extends Object implements LongStream, DebuggableStreaming<Long>
LongStream wrapper, which allows overriding of only
two methods to allow seeing stream operation in realtime.LongStream.Builder| Modifier | Constructor and Description |
|---|---|
protected |
DebugLongStream(LongStream stream,
boolean outputResults) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuilder, concat, empty, generate, iterate, of, of, range, rangeClosedprotected DebugLongStream(LongStream stream, boolean outputResults)
public static DebugLongStream of(LongStream stream)
DebugLongStream using the default typestream - The LongStream to wrapDebugLongStream wrapper of the provided LongStreampublic static DebugLongStream of(LongStream stream, boolean outputResults)
DebugLongStream using the default typestream - The LongStream to wrapoutputResults - true to output the results of the LongStream as it is operated uponDebugLongStream wrapper of the provided LongStreampublic static DebugLongStream of(LongStream stream, Class<? extends DebugLongStream> type)
DebugLongStream of the type parameter passed to the method. This is the appropriate
way to instantiate the DebugLongStream, as future caching mechanisms will be in place to optimize this.
You may however expose the constructor if you so choose.stream - The LongStream to create a DebugLongStream of.type - The class representing the type of the DebugLongStream to instantiateDebugLongStream of the provided LongStreampublic static DebugLongStream of(LongStream stream, boolean outputResults, Class<? extends DebugLongStream> type)
DebugLongStream of the type parameter passed to the method. This is the appropriate
way to instantiate the DebugLongStream, as future caching mechanisms will be in place to optimize this.
You may however expose the constructor if you so choose.stream - The LongStream to create a DebugLongStream of.outputResults - true to output the results of the LongStream as it is operated upontype - The class representing the type of the DebugLongStream to instantiateDebugLongStream of the provided LongStream, or the base class instance of
DebugLongStream if the type either failed to instantiate or was null.protected <R> R operate(Function<? super LongStream,? extends R> action)
Stream 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".
Stream will need to be recreated each time.protected void operateVoid(Consumer<? super LongStream> action)
Stream 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 StreamDebugStream.operate(Function)public static <D> DebugLongStream mapFromObject(DebuggableStreaming<D> debugStream, ToLongFunction<? super D> mapper)
public static <D> DebugLongStream flatMapFromObject(DebuggableStreaming<D> debugStream, Function<? super D,? extends LongStream> mapper)
public LongStream filter(LongPredicate predicate)
filter in interface LongStreampublic LongStream map(LongUnaryOperator mapper)
map in interface LongStreampublic <U> Stream<U> mapToObj(LongFunction<? extends U> mapper)
mapToObj in interface LongStreampublic IntStream mapToInt(LongToIntFunction mapper)
mapToInt in interface LongStreampublic DoubleStream mapToDouble(LongToDoubleFunction mapper)
mapToDouble in interface LongStreampublic LongStream flatMap(LongFunction<? extends LongStream> mapper)
flatMap in interface LongStreampublic LongStream distinct()
distinct in interface LongStreampublic LongStream sorted()
sorted in interface LongStreampublic LongStream peek(LongConsumer action)
peek in interface LongStreampublic LongStream limit(long maxSize)
limit in interface LongStreampublic LongStream skip(long n)
skip in interface LongStreampublic void forEach(LongConsumer action)
forEach in interface LongStreampublic void forEachOrdered(LongConsumer action)
forEachOrdered in interface LongStreampublic long[] toArray()
toArray in interface LongStreampublic long reduce(long identity,
LongBinaryOperator op)
reduce in interface LongStreampublic OptionalLong reduce(LongBinaryOperator op)
reduce in interface LongStreampublic <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R,R> combiner)
collect in interface LongStreampublic long sum()
sum in interface LongStreampublic OptionalLong min()
min in interface LongStreampublic OptionalLong max()
max in interface LongStreampublic long count()
count in interface LongStreampublic OptionalDouble average()
average in interface LongStreampublic LongSummaryStatistics summaryStatistics()
summaryStatistics in interface LongStreampublic boolean anyMatch(LongPredicate predicate)
anyMatch in interface LongStreampublic boolean allMatch(LongPredicate predicate)
allMatch in interface LongStreampublic boolean noneMatch(LongPredicate predicate)
noneMatch in interface LongStreampublic OptionalLong findFirst()
findFirst in interface LongStreampublic OptionalLong findAny()
findAny in interface LongStreampublic DoubleStream asDoubleStream()
asDoubleStream in interface LongStreampublic Stream<Long> boxed()
boxed in interface LongStreampublic LongStream sequential()
sequential in interface BaseStream<Long,LongStream>sequential in interface LongStreampublic LongStream parallel()
parallel in interface BaseStream<Long,LongStream>parallel in interface LongStreampublic LongStream unordered()
unordered in interface BaseStream<Long,LongStream>public LongStream onClose(Runnable closeHandler)
onClose in interface BaseStream<Long,LongStream>public void close()
close in interface AutoCloseableclose in interface BaseStream<Long,LongStream>public PrimitiveIterator.OfLong iterator()
iterator in interface BaseStream<Long,LongStream>iterator in interface LongStreampublic Spliterator.OfLong spliterator()
spliterator in interface BaseStream<Long,LongStream>spliterator in interface LongStreampublic boolean isParallel()
isParallel in interface BaseStream<Long,LongStream>public Stream<Long> getRawStream()
getRawStream in interface DebuggableStreaming<Long>public boolean isOutputtingResults()
isOutputtingResults in interface DebuggableStreaming<Long>Copyright © 2017. All rights reserved.