Package org.hibernate.query.spi
Class DoubleStreamDecorator
- java.lang.Object
-
- org.hibernate.query.spi.DoubleStreamDecorator
-
- All Implemented Interfaces:
AutoCloseable
,BaseStream<Double,DoubleStream>
,DoubleStream
public class DoubleStreamDecorator extends Object implements DoubleStream
TheDoubleStreamDecorator
wraps a JavaDoubleStream
and registers acloseHandler
which is passed further to any resultingStream
.The goal of the
DoubleStreamDecorator
is to close the underlyingDoubleStream
upon calling a terminal operation.- Since:
- 5.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.stream.DoubleStream
DoubleStream.Builder
-
-
Constructor Summary
Constructors Constructor Description DoubleStreamDecorator(DoubleStream 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.DoubleStream
dropWhile, takeWhile
-
-
-
-
Constructor Detail
-
DoubleStreamDecorator
public DoubleStreamDecorator(DoubleStream delegate, Runnable closeHandler)
-
-
Method Detail
-
filter
public DoubleStream filter(DoublePredicate predicate)
- Specified by:
filter
in interfaceDoubleStream
-
map
public DoubleStream map(DoubleUnaryOperator mapper)
- Specified by:
map
in interfaceDoubleStream
-
mapToObj
public <U> Stream<U> mapToObj(DoubleFunction<? extends U> mapper)
- Specified by:
mapToObj
in interfaceDoubleStream
-
mapToInt
public IntStream mapToInt(DoubleToIntFunction mapper)
- Specified by:
mapToInt
in interfaceDoubleStream
-
mapToLong
public LongStream mapToLong(DoubleToLongFunction mapper)
- Specified by:
mapToLong
in interfaceDoubleStream
-
flatMap
public DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper)
- Specified by:
flatMap
in interfaceDoubleStream
-
distinct
public DoubleStream distinct()
- Specified by:
distinct
in interfaceDoubleStream
-
sorted
public DoubleStream sorted()
- Specified by:
sorted
in interfaceDoubleStream
-
peek
public DoubleStream peek(DoubleConsumer action)
- Specified by:
peek
in interfaceDoubleStream
-
limit
public DoubleStream limit(long maxSize)
- Specified by:
limit
in interfaceDoubleStream
-
skip
public DoubleStream skip(long n)
- Specified by:
skip
in interfaceDoubleStream
-
forEach
public void forEach(DoubleConsumer action)
- Specified by:
forEach
in interfaceDoubleStream
-
forEachOrdered
public void forEachOrdered(DoubleConsumer action)
- Specified by:
forEachOrdered
in interfaceDoubleStream
-
toArray
public double[] toArray()
- Specified by:
toArray
in interfaceDoubleStream
-
reduce
public double reduce(double identity, DoubleBinaryOperator op)
- Specified by:
reduce
in interfaceDoubleStream
-
reduce
public OptionalDouble reduce(DoubleBinaryOperator op)
- Specified by:
reduce
in interfaceDoubleStream
-
collect
public <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R,R> combiner)
- Specified by:
collect
in interfaceDoubleStream
-
sum
public double sum()
- Specified by:
sum
in interfaceDoubleStream
-
min
public OptionalDouble min()
- Specified by:
min
in interfaceDoubleStream
-
max
public OptionalDouble max()
- Specified by:
max
in interfaceDoubleStream
-
count
public long count()
- Specified by:
count
in interfaceDoubleStream
-
average
public OptionalDouble average()
- Specified by:
average
in interfaceDoubleStream
-
summaryStatistics
public DoubleSummaryStatistics summaryStatistics()
- Specified by:
summaryStatistics
in interfaceDoubleStream
-
anyMatch
public boolean anyMatch(DoublePredicate predicate)
- Specified by:
anyMatch
in interfaceDoubleStream
-
allMatch
public boolean allMatch(DoublePredicate predicate)
- Specified by:
allMatch
in interfaceDoubleStream
-
noneMatch
public boolean noneMatch(DoublePredicate predicate)
- Specified by:
noneMatch
in interfaceDoubleStream
-
findFirst
public OptionalDouble findFirst()
- Specified by:
findFirst
in interfaceDoubleStream
-
findAny
public OptionalDouble findAny()
- Specified by:
findAny
in interfaceDoubleStream
-
boxed
public Stream<Double> boxed()
- Specified by:
boxed
in interfaceDoubleStream
-
sequential
public DoubleStream sequential()
- Specified by:
sequential
in interfaceBaseStream<Double,DoubleStream>
- Specified by:
sequential
in interfaceDoubleStream
-
parallel
public DoubleStream parallel()
- Specified by:
parallel
in interfaceBaseStream<Double,DoubleStream>
- Specified by:
parallel
in interfaceDoubleStream
-
unordered
public DoubleStream unordered()
- Specified by:
unordered
in interfaceBaseStream<Double,DoubleStream>
-
onClose
public DoubleStream onClose(Runnable closeHandler)
- Specified by:
onClose
in interfaceBaseStream<Double,DoubleStream>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<Double,DoubleStream>
-
iterator
public PrimitiveIterator.OfDouble iterator()
- Specified by:
iterator
in interfaceBaseStream<Double,DoubleStream>
- Specified by:
iterator
in interfaceDoubleStream
-
spliterator
public Spliterator.OfDouble spliterator()
- Specified by:
spliterator
in interfaceBaseStream<Double,DoubleStream>
- Specified by:
spliterator
in interfaceDoubleStream
-
isParallel
public boolean isParallel()
- Specified by:
isParallel
in interfaceBaseStream<Double,DoubleStream>
-
-