다음을 통해 공유


IComparator.NullsLast(IComparator) Method

Definition

Returns a null-friendly comparator that considers null to be greater than non-null.

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

Parameters

comparator
IComparator

a Comparator for comparing non-null values

Returns

a comparator that considers null to be greater than non-null, and compares non-null objects with the supplied Comparator.

Attributes

Remarks

Returns a null-friendly comparator that considers null to be greater than non-null. When both are null, they are considered equal. If both are non-null, the specified Comparator is used to determine the order. If the specified comparator is null, then the returned comparator considers all non-null values to be equal.

The returned comparator is serializable if the specified comparator is serializable.

Added in 1.8.

Java documentation for java.util.Comparator.nullsLast(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