Uses of Interface
java.util.stream.Gatherer.Downstream
Package
Description
Classes to support functional-style operations on streams of elements, such
as map-reduce transformations on collections.
-
Uses of Gatherer.Downstream in java.util.stream
Modifier and TypeMethodDescriptionstatic <A,
R> BiConsumer <A, Gatherer.Downstream<? super R>> Gatherer.defaultFinisher()
Returns afinisher
which is the default finisher of aGatherer
.default BiConsumer
<A, Gatherer.Downstream<? super R>> Gatherer.finisher()
A function which accepts the final intermediate state and aGatherer.Downstream
object, allowing to perform a final action at the end of input elements.Modifier and TypeMethodDescriptionboolean
Gatherer.Integrator.integrate
(A state, T element, Gatherer.Downstream<? super R> downstream) Performs an action given: the current state, the next element, and a downstream object; potentially inspecting and/or updating the state, optionally sending any number of elements downstream -- and then returns whether more elements are to be consumed or not.Modifier and TypeMethodDescriptionstatic <T,
A, R> Gatherer <T, A, R> Gatherer.of
(Supplier<A> initializer, Gatherer.Integrator<A, T, R> integrator, BinaryOperator<A> combiner, BiConsumer<A, Gatherer.Downstream<? super R>> finisher) Returns a new, parallelizable,Gatherer
described by the giveninitializer
,integrator
,combiner
andfinisher
.Gatherer.of
(Gatherer.Integrator<Void, T, R> integrator, BiConsumer<Void, Gatherer.Downstream<? super R>> finisher) Returns a new, parallelizable, and statelessGatherer
described by the givenintegrator
andfinisher
.static <T,
A, R> Gatherer <T, A, R> Gatherer.ofSequential
(Supplier<A> initializer, Gatherer.Integrator<A, T, R> integrator, BiConsumer<A, Gatherer.Downstream<? super R>> finisher) Returns a new, sequential,Gatherer
described by the giveninitializer
,integrator
, andfinisher
.Gatherer.ofSequential
(Gatherer.Integrator<Void, T, R> integrator, BiConsumer<Void, Gatherer.Downstream<? super R>> finisher) Returns a new, sequential, and statelessGatherer
described by the givenintegrator
andfinisher
.