Package org.hibernate.query.spi
Class LongStreamDecorator
- java.lang.Object
-
- org.hibernate.query.spi.LongStreamDecorator
-
- All Implemented Interfaces:
AutoCloseable,BaseStream<Long,LongStream>,LongStream
public class LongStreamDecorator extends Object implements LongStream
TheLongStreamDecoratorwraps 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.stream.LongStream
LongStream.Builder
-
-
Constructor Summary
Constructors Constructor Description LongStreamDecorator(LongStream delegate, Runnable closeHandler)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.stream.LongStream
dropWhile, takeWhile
-
-
-
-
Constructor Detail
-
LongStreamDecorator
public LongStreamDecorator(LongStream delegate, Runnable closeHandler)
-
-
Method Detail
-
filter
public LongStream filter(LongPredicate predicate)
- Specified by:
filterin interfaceLongStream
-
map
public LongStream map(LongUnaryOperator mapper)
- Specified by:
mapin interfaceLongStream
-
mapToObj
public <U> Stream<U> mapToObj(LongFunction<? extends U> mapper)
- Specified by:
mapToObjin interfaceLongStream
-
mapToInt
public IntStream mapToInt(LongToIntFunction mapper)
- Specified by:
mapToIntin interfaceLongStream
-
mapToDouble
public DoubleStream mapToDouble(LongToDoubleFunction mapper)
- Specified by:
mapToDoublein interfaceLongStream
-
flatMap
public LongStream flatMap(LongFunction<? extends LongStream> mapper)
- Specified by:
flatMapin interfaceLongStream
-
distinct
public LongStream distinct()
- Specified by:
distinctin interfaceLongStream
-
sorted
public LongStream sorted()
- Specified by:
sortedin interfaceLongStream
-
peek
public LongStream peek(LongConsumer action)
- Specified by:
peekin interfaceLongStream
-
limit
public LongStream limit(long maxSize)
- Specified by:
limitin interfaceLongStream
-
skip
public LongStream skip(long n)
- Specified by:
skipin interfaceLongStream
-
forEach
public void forEach(LongConsumer action)
- Specified by:
forEachin interfaceLongStream
-
forEachOrdered
public void forEachOrdered(LongConsumer action)
- Specified by:
forEachOrderedin interfaceLongStream
-
toArray
public long[] toArray()
- Specified by:
toArrayin interfaceLongStream
-
reduce
public long reduce(long identity, LongBinaryOperator op)- Specified by:
reducein interfaceLongStream
-
reduce
public OptionalLong reduce(LongBinaryOperator op)
- Specified by:
reducein interfaceLongStream
-
collect
public <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R,R> combiner)
- Specified by:
collectin interfaceLongStream
-
sum
public long sum()
- Specified by:
sumin interfaceLongStream
-
min
public OptionalLong min()
- Specified by:
minin interfaceLongStream
-
max
public OptionalLong max()
- Specified by:
maxin interfaceLongStream
-
count
public long count()
- Specified by:
countin interfaceLongStream
-
average
public OptionalDouble average()
- Specified by:
averagein interfaceLongStream
-
summaryStatistics
public LongSummaryStatistics summaryStatistics()
- Specified by:
summaryStatisticsin interfaceLongStream
-
anyMatch
public boolean anyMatch(LongPredicate predicate)
- Specified by:
anyMatchin interfaceLongStream
-
allMatch
public boolean allMatch(LongPredicate predicate)
- Specified by:
allMatchin interfaceLongStream
-
noneMatch
public boolean noneMatch(LongPredicate predicate)
- Specified by:
noneMatchin interfaceLongStream
-
findFirst
public OptionalLong findFirst()
- Specified by:
findFirstin interfaceLongStream
-
findAny
public OptionalLong findAny()
- Specified by:
findAnyin interfaceLongStream
-
asDoubleStream
public DoubleStream asDoubleStream()
- Specified by:
asDoubleStreamin interfaceLongStream
-
boxed
public Stream<Long> boxed()
- Specified by:
boxedin interfaceLongStream
-
sequential
public LongStream sequential()
- Specified by:
sequentialin interfaceBaseStream<Long,LongStream>- Specified by:
sequentialin interfaceLongStream
-
parallel
public LongStream parallel()
- Specified by:
parallelin interfaceBaseStream<Long,LongStream>- Specified by:
parallelin interfaceLongStream
-
unordered
public LongStream unordered()
- Specified by:
unorderedin interfaceBaseStream<Long,LongStream>
-
onClose
public LongStream onClose(Runnable closeHandler)
- Specified by:
onClosein interfaceBaseStream<Long,LongStream>
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStream<Long,LongStream>
-
iterator
public PrimitiveIterator.OfLong iterator()
- Specified by:
iteratorin interfaceBaseStream<Long,LongStream>- Specified by:
iteratorin interfaceLongStream
-
spliterator
public Spliterator.OfLong spliterator()
- Specified by:
spliteratorin interfaceBaseStream<Long,LongStream>- Specified by:
spliteratorin interfaceLongStream
-
isParallel
public boolean isParallel()
- Specified by:
isParallelin interfaceBaseStream<Long,LongStream>
-
-