public class IntStreamDecorator extends Object implements IntStream
IntStreamDecorator wraps a Java IntStream and registers a closeHandler
which is passed further to any resulting Stream.
The goal of the IntStreamDecorator is to close the underlying IntStream upon
calling a terminal operation.
IntStream.Builder| Constructor and Description |
|---|
IntStreamDecorator(IntStream delegate,
Runnable closeHandler) |
public IntStream filter(IntPredicate predicate)
public IntStream map(IntUnaryOperator mapper)
public <U> Stream<U> mapToObj(IntFunction<? extends U> mapper)
public LongStream mapToLong(IntToLongFunction mapper)
public DoubleStream mapToDouble(IntToDoubleFunction mapper)
mapToDouble in interface IntStreampublic IntStream flatMap(IntFunction<? extends IntStream> mapper)
public IntStream peek(IntConsumer action)
public void forEach(IntConsumer action)
public void forEachOrdered(IntConsumer action)
forEachOrdered in interface IntStreampublic int reduce(int identity,
IntBinaryOperator op)
public OptionalInt reduce(IntBinaryOperator op)
public <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R,R> combiner)
public OptionalInt min()
public OptionalInt max()
public OptionalDouble average()
public IntSummaryStatistics summaryStatistics()
summaryStatistics in interface IntStreampublic boolean anyMatch(IntPredicate predicate)
public boolean allMatch(IntPredicate predicate)
public boolean noneMatch(IntPredicate predicate)
public OptionalInt findFirst()
public OptionalInt findAny()
public LongStream asLongStream()
asLongStream in interface IntStreampublic DoubleStream asDoubleStream()
asDoubleStream in interface IntStreampublic IntStream sequential()
sequential in interface BaseStream<Integer,IntStream>sequential in interface IntStreampublic IntStream parallel()
public IntStream unordered()
unordered in interface BaseStream<Integer,IntStream>public IntStream onClose(Runnable closeHandler)
onClose in interface BaseStream<Integer,IntStream>public void close()
close in interface AutoCloseableclose in interface BaseStream<Integer,IntStream>public PrimitiveIterator.OfInt iterator()
public Spliterator.OfInt spliterator()
spliterator in interface BaseStream<Integer,IntStream>spliterator in interface IntStreampublic boolean isParallel()
isParallel in interface BaseStream<Integer,IntStream>Copyright © 2001-2022 Red Hat, Inc. All Rights Reserved.