Aracılığıyla paylaş


Collectors.Filtering(IPredicate, ICollector) Method

Definition

Adapts a Collector to one accepting elements of the same type T by applying the predicate to each input element and only accumulating if the predicate returns true.

[Android.Runtime.Register("filtering", "(Ljava/util/function/Predicate;Ljava/util/stream/Collector;)Ljava/util/stream/Collector;", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "A", "R" })]
public static Java.Util.Streams.ICollector? Filtering (Java.Util.Functions.IPredicate? predicate, Java.Util.Streams.ICollector? downstream);
[<Android.Runtime.Register("filtering", "(Ljava/util/function/Predicate;Ljava/util/stream/Collector;)Ljava/util/stream/Collector;", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "A", "R" })>]
static member Filtering : Java.Util.Functions.IPredicate * Java.Util.Streams.ICollector -> Java.Util.Streams.ICollector

Parameters

predicate
IPredicate

a predicate to be applied to the input elements

downstream
ICollector

a collector which will accept values that match the predicate

Returns

a collector which applies the predicate to the input elements and provides matching elements to the downstream collector

Attributes

Remarks

Adapts a Collector to one accepting elements of the same type T by applying the predicate to each input element and only accumulating if the predicate returns true.

Added in 9.

Java documentation for java.util.stream.Collectors.filtering(java.util.function.Predicate<? super T>, java.util.stream.Collector<? super T, A, 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