Gatherers.Scan(ISupplier, IBiFunction) Method

Definition

Returns a Gatherer that performs a Prefix Scan -- an incremental accumulation -- using the provided functions.

[Android.Runtime.Register("scan", "(Ljava/util/function/Supplier;Ljava/util/function/BiFunction;)Ljava/util/stream/Gatherer;", "", ApiSince=36)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "R" })]
public static Java.Util.Streams.IGatherer? Scan(Java.Util.Functions.ISupplier? initial, Java.Util.Functions.IBiFunction? scanner);
[<Android.Runtime.Register("scan", "(Ljava/util/function/Supplier;Ljava/util/function/BiFunction;)Ljava/util/stream/Gatherer;", "", ApiSince=36)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "R" })>]
static member Scan : Java.Util.Functions.ISupplier * Java.Util.Functions.IBiFunction -> Java.Util.Streams.IGatherer

Parameters

initial
ISupplier

the supplier of the initial value for the scanner

scanner
IBiFunction

the function to apply for each element

Returns

a new Gatherer which performs a prefix scan

Attributes

Remarks

Returns a Gatherer that performs a Prefix Scan -- an incremental accumulation -- using the provided functions. Starting with an initial value obtained from the Supplier, each subsequent value is obtained by applying the BiFunction to the current value and the next input element, after which the resulting value is produced downstream.

Example: {

Java documentation for java.util.stream.Gatherers.scan(java.util.function.Supplier<R>, java.util.function.BiFunction<? super R, ? super T, ? extends R>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to