Udostępnij za pośrednictwem


Collectors.Reducing Method

Definition

Overloads

Reducing(Object, IFunction, IBinaryOperator)

Returns a Collector which performs a reduction of its input elements under a specified mapping function and BinaryOperator.

Reducing(IBinaryOperator)

Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator.

Reducing(Object, IBinaryOperator)

Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator using the provided identity.

Reducing(Object, IFunction, IBinaryOperator)

Returns a Collector which performs a reduction of its input elements under a specified mapping function and BinaryOperator.

[Android.Runtime.Register("reducing", "(Ljava/lang/Object;Ljava/util/function/Function;Ljava/util/function/BinaryOperator;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "U" })]
public static Java.Util.Streams.ICollector? Reducing (Java.Lang.Object? identity, Java.Util.Functions.IFunction? mapper, Java.Util.Functions.IBinaryOperator? op);
[<Android.Runtime.Register("reducing", "(Ljava/lang/Object;Ljava/util/function/Function;Ljava/util/function/BinaryOperator;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "U" })>]
static member Reducing : Java.Lang.Object * Java.Util.Functions.IFunction * Java.Util.Functions.IBinaryOperator -> Java.Util.Streams.ICollector

Parameters

identity
Object

the identity value for the reduction (also, the value that is returned when there are no input elements)

mapper
IFunction

a mapping function to apply to each input value

op
IBinaryOperator

a BinaryOperator<U> used to reduce the mapped values

Returns

a Collector implementing the map-reduce operation

Attributes

Remarks

Returns a Collector which performs a reduction of its input elements under a specified mapping function and BinaryOperator. This is a generalization of #reducing(Object, BinaryOperator) which allows a transformation of the elements before reduction.

Java documentation for java.util.stream.Collectors.reducing(U, java.util.function.Function<? super T, ? extends U>, java.util.function.BinaryOperator<U>).

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

Reducing(IBinaryOperator)

Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator.

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

Parameters

op
IBinaryOperator

a BinaryOperator<T> used to reduce the input elements

Returns

a Collector which implements the reduction operation

Attributes

Remarks

Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator. The result is described as an Optional<T>.

Java documentation for java.util.stream.Collectors.reducing(java.util.function.BinaryOperator<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

Reducing(Object, IBinaryOperator)

Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator using the provided identity.

[Android.Runtime.Register("reducing", "(Ljava/lang/Object;Ljava/util/function/BinaryOperator;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.Streams.ICollector? Reducing (Java.Lang.Object? identity, Java.Util.Functions.IBinaryOperator? op);
[<Android.Runtime.Register("reducing", "(Ljava/lang/Object;Ljava/util/function/BinaryOperator;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Reducing : Java.Lang.Object * Java.Util.Functions.IBinaryOperator -> Java.Util.Streams.ICollector

Parameters

identity
Object

the identity value for the reduction (also, the value that is returned when there are no input elements)

op
IBinaryOperator

a BinaryOperator<T> used to reduce the input elements

Returns

a Collector which implements the reduction operation

Attributes

Remarks

Returns a Collector which performs a reduction of its input elements under a specified BinaryOperator using the provided identity.

Java documentation for java.util.stream.Collectors.reducing(T, java.util.function.BinaryOperator<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