Objects.Compare(Object, Object, IComparator) Method

Definition

Returns 0 if the arguments are identical and c.compare(a, b) otherwise.

[Android.Runtime.Register("compare", "(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/Comparator;)I", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static int Compare (Java.Lang.Object? a, Java.Lang.Object? b, Java.Util.IComparator c);
[<Android.Runtime.Register("compare", "(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/Comparator;)I", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Compare : Java.Lang.Object * Java.Lang.Object * Java.Util.IComparator -> int

Parameters

a
Object

an object

b
Object

an object to be compared with a

c
IComparator

the Comparator to compare the first two arguments

Returns

Int32

0 if the arguments are identical and c.compare(a, b) otherwise.

Attributes

Remarks

Java documentation for java.util.Objects.compare(T, T, 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