Share via


Collectors.SummingDouble(IToDoubleFunction) Method

Definition

Returns a Collector that produces the sum of a double-valued function applied to the input elements.

[Android.Runtime.Register("summingDouble", "(Ljava/util/function/ToDoubleFunction;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.Streams.ICollector? SummingDouble (Java.Util.Functions.IToDoubleFunction? mapper);
[<Android.Runtime.Register("summingDouble", "(Ljava/util/function/ToDoubleFunction;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member SummingDouble : Java.Util.Functions.IToDoubleFunction -> Java.Util.Streams.ICollector

Parameters

mapper
IToDoubleFunction

a function extracting the property to be summed

Returns

a Collector that produces the sum of a derived property

Attributes

Remarks

Returns a Collector that produces the sum of a double-valued function applied to the input elements. If no elements are present, the result is 0.

The sum returned can vary depending upon the order in which values are recorded, due to accumulated rounding error in addition of values of differing magnitudes. Values sorted by increasing absolute magnitude tend to yield more accurate results. If any recorded value is a NaN or the sum is at any point a NaN then the sum will be NaN.

Java documentation for java.util.stream.Collectors.summingDouble(java.util.function.ToDoubleFunction<? super T>).

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