Android Guides | Samples

Java.Util.IComparator

A Comparator is used to compare two objects to determine their ordering with respect to each other.

See Also: IComparator

Syntax

[Android.Runtime.Register("java/util/Comparator", "", "Java.Util.IComparatorInvoker")]
public interface IComparator : IJavaObject, IDisposable

Remarks

A Comparator is used to compare two objects to determine their ordering with respect to each other. On a given Collection, a Comparator can be used to obtain a sorted Collection which is totally ordered. For a Comparator to be consistent with equals, its {code #compare(Object, Object)} method has to return zero for each pair of elements (a,b) where a.equals(b) holds true. It is recommended that a Comparator implements ISerializable.

[Android Documentation]

Requirements

Namespace: Java.Util
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Util.IComparator are listed below.

Public Methods

Compare(Object, Object) : Int32
Equals(Object) : Boolean
Compares this Comparator with the specified Object and indicates whether they are equal.