Package org.hibernate.query.spi
Class IntStreamDecorator
- java.lang.Object
-
- org.hibernate.query.spi.IntStreamDecorator
-
- All Implemented Interfaces:
AutoCloseable
,BaseStream<Integer,IntStream>
,IntStream
public class IntStreamDecorator extends Object implements IntStream
TheIntStreamDecorator
wraps a JavaIntStream
and registers acloseHandler
which is passed further to any resultingStream
.The goal of the
IntStreamDecorator
is to close the underlyingIntStream
upon calling a terminal operation.- Since:
- 5.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.stream.IntStream
IntStream.Builder
-
-
Constructor Summary
Constructors Constructor Description IntStreamDecorator(IntStream delegate, Runnable closeHandler)
-
Method Summary
-
-
-
Method Detail
-
filter
public IntStream filter(IntPredicate predicate)
-
map
public IntStream map(IntUnaryOperator mapper)
-
mapToObj
public <U> Stream<U> mapToObj(IntFunction<? extends U> mapper)
-
mapToLong
public LongStream mapToLong(IntToLongFunction mapper)
-
mapToDouble
public DoubleStream mapToDouble(IntToDoubleFunction mapper)
- Specified by:
mapToDouble
in interfaceIntStream
-
flatMap
public IntStream flatMap(IntFunction<? extends IntStream> mapper)
-
peek
public IntStream peek(IntConsumer action)
-
forEach
public void forEach(IntConsumer action)
-
forEachOrdered
public void forEachOrdered(IntConsumer action)
- Specified by:
forEachOrdered
in interfaceIntStream
-
reduce
public int reduce(int identity, IntBinaryOperator op)
-
reduce
public OptionalInt reduce(IntBinaryOperator op)
-
collect
public <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R,R> combiner)
-
min
public OptionalInt min()
-
max
public OptionalInt max()
-
average
public OptionalDouble average()
-
summaryStatistics
public IntSummaryStatistics summaryStatistics()
- Specified by:
summaryStatistics
in interfaceIntStream
-
anyMatch
public boolean anyMatch(IntPredicate predicate)
-
allMatch
public boolean allMatch(IntPredicate predicate)
-
noneMatch
public boolean noneMatch(IntPredicate predicate)
-
findFirst
public OptionalInt findFirst()
-
findAny
public OptionalInt findAny()
-
asLongStream
public LongStream asLongStream()
- Specified by:
asLongStream
in interfaceIntStream
-
asDoubleStream
public DoubleStream asDoubleStream()
- Specified by:
asDoubleStream
in interfaceIntStream
-
sequential
public IntStream sequential()
- Specified by:
sequential
in interfaceBaseStream<Integer,IntStream>
- Specified by:
sequential
in interfaceIntStream
-
parallel
public IntStream parallel()
-
unordered
public IntStream unordered()
- Specified by:
unordered
in interfaceBaseStream<Integer,IntStream>
-
onClose
public IntStream onClose(Runnable closeHandler)
- Specified by:
onClose
in interfaceBaseStream<Integer,IntStream>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<Integer,IntStream>
-
iterator
public PrimitiveIterator.OfInt iterator()
-
spliterator
public Spliterator.OfInt spliterator()
- Specified by:
spliterator
in interfaceBaseStream<Integer,IntStream>
- Specified by:
spliterator
in interfaceIntStream
-
isParallel
public boolean isParallel()
- Specified by:
isParallel
in interfaceBaseStream<Integer,IntStream>
-
-