public static interface Gatherer.Integrator.Greedy
implements Integrator<A, T, R>

java.util.stream.Gatherer.Integrator.Greedy<A, T, R>



Greedy Integrators consume all their input, and may only relay that the downstream does not want more elements.

Summary

Inherited methods

From interface java.util.stream.Gatherer.Integrator

abstract boolean integrate(A state, T element, 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.

static <A, T, R> Integrator<A, T, R> of(Integrator<A, T, R> integrator)

Factory method for turning Integrator-shaped lambdas into Integrators.

static <A, T, R> Greedy<A, T, R> ofGreedy(Greedy<A, T, R> greedy)

Factory method for turning Integrator-shaped lambdas into Greedy Integrators.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-09-17 UTC.