Udostępnij za pośrednictwem


Collectors.MaxBy(IComparator) Method

Definition

Returns a Collector that produces the maximal element according to a given Comparator, described as an Optional<T>.

[Android.Runtime.Register("maxBy", "(Ljava/util/Comparator;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.Streams.ICollector? MaxBy (Java.Util.IComparator? comparator);
[<Android.Runtime.Register("maxBy", "(Ljava/util/Comparator;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member MaxBy : Java.Util.IComparator -> Java.Util.Streams.ICollector

Parameters

comparator
IComparator

a Comparator for comparing elements

Returns

a Collector that produces the maximal value

Attributes

Remarks

Returns a Collector that produces the maximal element according to a given Comparator, described as an Optional<T>.

Java documentation for java.util.stream.Collectors.maxBy(java.util.Comparator<? 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