Package org.hibernate.query.spi
Class LongStreamDecorator
- java.lang.Object
-
- org.hibernate.query.spi.LongStreamDecorator
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>,java.util.stream.LongStream
public class LongStreamDecorator extends java.lang.Object implements java.util.stream.LongStreamTheLongStreamDecoratorwraps a JavaLongStreamand registers acloseHandlerwhich is passed further to any resultingStream. The goal of theLongStreamDecoratoris to close the underlyingLongStreamupon calling a terminal operation.- Since:
- 5.4
-
-
Constructor Summary
Constructors Constructor Description LongStreamDecorator(java.util.stream.LongStream delegate, java.lang.Runnable closeHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallMatch(java.util.function.LongPredicate predicate)booleananyMatch(java.util.function.LongPredicate predicate)java.util.stream.DoubleStreamasDoubleStream()java.util.OptionalDoubleaverage()java.util.stream.Stream<java.lang.Long>boxed()voidclose()<R> Rcollect(java.util.function.Supplier<R> supplier, java.util.function.ObjLongConsumer<R> accumulator, java.util.function.BiConsumer<R,R> combiner)longcount()java.util.stream.LongStreamdistinct()java.util.stream.LongStreamfilter(java.util.function.LongPredicate predicate)java.util.OptionalLongfindAny()java.util.OptionalLongfindFirst()java.util.stream.LongStreamflatMap(java.util.function.LongFunction<? extends java.util.stream.LongStream> mapper)voidforEach(java.util.function.LongConsumer action)voidforEachOrdered(java.util.function.LongConsumer action)booleanisParallel()java.util.PrimitiveIterator.OfLongiterator()java.util.stream.LongStreamlimit(long maxSize)java.util.stream.LongStreammap(java.util.function.LongUnaryOperator mapper)java.util.stream.DoubleStreammapToDouble(java.util.function.LongToDoubleFunction mapper)java.util.stream.IntStreammapToInt(java.util.function.LongToIntFunction mapper)<U> java.util.stream.Stream<U>mapToObj(java.util.function.LongFunction<? extends U> mapper)java.util.OptionalLongmax()java.util.OptionalLongmin()booleannoneMatch(java.util.function.LongPredicate predicate)java.util.stream.LongStreamonClose(java.lang.Runnable closeHandler)java.util.stream.LongStreamparallel()java.util.stream.LongStreampeek(java.util.function.LongConsumer action)longreduce(long identity, java.util.function.LongBinaryOperator op)java.util.OptionalLongreduce(java.util.function.LongBinaryOperator op)java.util.stream.LongStreamsequential()java.util.stream.LongStreamskip(long n)java.util.stream.LongStreamsorted()java.util.Spliterator.OfLongspliterator()longsum()java.util.LongSummaryStatisticssummaryStatistics()long[]toArray()java.util.stream.LongStreamunordered()
-
-
-
Method Detail
-
filter
public java.util.stream.LongStream filter(java.util.function.LongPredicate predicate)
- Specified by:
filterin interfacejava.util.stream.LongStream
-
map
public java.util.stream.LongStream map(java.util.function.LongUnaryOperator mapper)
- Specified by:
mapin interfacejava.util.stream.LongStream
-
mapToObj
public <U> java.util.stream.Stream<U> mapToObj(java.util.function.LongFunction<? extends U> mapper)
- Specified by:
mapToObjin interfacejava.util.stream.LongStream
-
mapToInt
public java.util.stream.IntStream mapToInt(java.util.function.LongToIntFunction mapper)
- Specified by:
mapToIntin interfacejava.util.stream.LongStream
-
mapToDouble
public java.util.stream.DoubleStream mapToDouble(java.util.function.LongToDoubleFunction mapper)
- Specified by:
mapToDoublein interfacejava.util.stream.LongStream
-
flatMap
public java.util.stream.LongStream flatMap(java.util.function.LongFunction<? extends java.util.stream.LongStream> mapper)
- Specified by:
flatMapin interfacejava.util.stream.LongStream
-
distinct
public java.util.stream.LongStream distinct()
- Specified by:
distinctin interfacejava.util.stream.LongStream
-
sorted
public java.util.stream.LongStream sorted()
- Specified by:
sortedin interfacejava.util.stream.LongStream
-
peek
public java.util.stream.LongStream peek(java.util.function.LongConsumer action)
- Specified by:
peekin interfacejava.util.stream.LongStream
-
limit
public java.util.stream.LongStream limit(long maxSize)
- Specified by:
limitin interfacejava.util.stream.LongStream
-
skip
public java.util.stream.LongStream skip(long n)
- Specified by:
skipin interfacejava.util.stream.LongStream
-
forEach
public void forEach(java.util.function.LongConsumer action)
- Specified by:
forEachin interfacejava.util.stream.LongStream
-
forEachOrdered
public void forEachOrdered(java.util.function.LongConsumer action)
- Specified by:
forEachOrderedin interfacejava.util.stream.LongStream
-
toArray
public long[] toArray()
- Specified by:
toArrayin interfacejava.util.stream.LongStream
-
reduce
public long reduce(long identity, java.util.function.LongBinaryOperator op)- Specified by:
reducein interfacejava.util.stream.LongStream
-
reduce
public java.util.OptionalLong reduce(java.util.function.LongBinaryOperator op)
- Specified by:
reducein interfacejava.util.stream.LongStream
-
collect
public <R> R collect(java.util.function.Supplier<R> supplier, java.util.function.ObjLongConsumer<R> accumulator, java.util.function.BiConsumer<R,R> combiner)- Specified by:
collectin interfacejava.util.stream.LongStream
-
sum
public long sum()
- Specified by:
sumin interfacejava.util.stream.LongStream
-
min
public java.util.OptionalLong min()
- Specified by:
minin interfacejava.util.stream.LongStream
-
max
public java.util.OptionalLong max()
- Specified by:
maxin interfacejava.util.stream.LongStream
-
count
public long count()
- Specified by:
countin interfacejava.util.stream.LongStream
-
average
public java.util.OptionalDouble average()
- Specified by:
averagein interfacejava.util.stream.LongStream
-
summaryStatistics
public java.util.LongSummaryStatistics summaryStatistics()
- Specified by:
summaryStatisticsin interfacejava.util.stream.LongStream
-
anyMatch
public boolean anyMatch(java.util.function.LongPredicate predicate)
- Specified by:
anyMatchin interfacejava.util.stream.LongStream
-
allMatch
public boolean allMatch(java.util.function.LongPredicate predicate)
- Specified by:
allMatchin interfacejava.util.stream.LongStream
-
noneMatch
public boolean noneMatch(java.util.function.LongPredicate predicate)
- Specified by:
noneMatchin interfacejava.util.stream.LongStream
-
findFirst
public java.util.OptionalLong findFirst()
- Specified by:
findFirstin interfacejava.util.stream.LongStream
-
findAny
public java.util.OptionalLong findAny()
- Specified by:
findAnyin interfacejava.util.stream.LongStream
-
asDoubleStream
public java.util.stream.DoubleStream asDoubleStream()
- Specified by:
asDoubleStreamin interfacejava.util.stream.LongStream
-
boxed
public java.util.stream.Stream<java.lang.Long> boxed()
- Specified by:
boxedin interfacejava.util.stream.LongStream
-
sequential
public java.util.stream.LongStream sequential()
- Specified by:
sequentialin interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>- Specified by:
sequentialin interfacejava.util.stream.LongStream
-
parallel
public java.util.stream.LongStream parallel()
- Specified by:
parallelin interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>- Specified by:
parallelin interfacejava.util.stream.LongStream
-
unordered
public java.util.stream.LongStream unordered()
- Specified by:
unorderedin interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>
-
onClose
public java.util.stream.LongStream onClose(java.lang.Runnable closeHandler)
- Specified by:
onClosein interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>
-
iterator
public java.util.PrimitiveIterator.OfLong iterator()
- Specified by:
iteratorin interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>- Specified by:
iteratorin interfacejava.util.stream.LongStream
-
spliterator
public java.util.Spliterator.OfLong spliterator()
- Specified by:
spliteratorin interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>- Specified by:
spliteratorin interfacejava.util.stream.LongStream
-
isParallel
public boolean isParallel()
- Specified by:
isParallelin interfacejava.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream>
-
-