IComparator Interface

Definition

A comparison function, which imposes a total ordering on some collection of objects.

[Android.Runtime.Register("java/util/Comparator", "", "Java.Util.IComparatorInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public interface IComparator : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("java/util/Comparator", "", "Java.Util.IComparatorInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
type IComparator = interface
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Derived
Attributes
Implements

Remarks

Java documentation for java.util.Comparator.

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.

Properties

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
JniIdentityHashCode (Inherited from IJavaPeerable)
JniManagedPeerState (Inherited from IJavaPeerable)
JniPeerMembers (Inherited from IJavaPeerable)
PeerReference (Inherited from IJavaPeerable)

Methods

Compare(Object, Object)

Compares its two arguments for order.

Comparing(IFunction)

Accepts a function that extracts a java.lang.Comparable Comparable sort key from a type T, and returns a Comparator<T> that compares by that sort key.

Comparing(IFunction, IComparator)

Accepts a function that extracts a sort key from a type T, and returns a Comparator<T> that compares by that sort key using the specified Comparator.

ComparingDouble(IToDoubleFunction)

Accepts a function that extracts a double sort key from a type T, and returns a Comparator<T> that compares by that sort key.

ComparingInt(IToIntFunction)

Accepts a function that extracts an int sort key from a type T, and returns a Comparator<T> that compares by that sort key.

ComparingLong(IToLongFunction)

Accepts a function that extracts a long sort key from a type T, and returns a Comparator<T> that compares by that sort key.

Disposed() (Inherited from IJavaPeerable)
DisposeUnlessReferenced() (Inherited from IJavaPeerable)
Equals(Object)

Indicates whether some other object is &quot;equal to&quot; this comparator.

Finalized() (Inherited from IJavaPeerable)
NaturalOrder()

Returns a comparator that compares Comparable objects in natural order.

NullsFirst(IComparator)

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

NullsLast(IComparator)

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

Reversed()

Returns a comparator that imposes the reverse ordering of this comparator.

ReverseOrder()

Returns a comparator that imposes the reverse of the <em>natural ordering</em>.

SetJniIdentityHashCode(Int32) (Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference) (Inherited from IJavaPeerable)
ThenComparing(IComparator)

Returns a lexicographic-order comparator with another comparator.

ThenComparing(IFunction)

Returns a lexicographic-order comparator with a function that extracts a Comparable sort key.

ThenComparing(IFunction, IComparator)

Returns a lexicographic-order comparator with a function that extracts a key to be compared with the given Comparator.

ThenComparingDouble(IToDoubleFunction)

Returns a lexicographic-order comparator with a function that extracts a double sort key.

ThenComparingInt(IToIntFunction)

Returns a lexicographic-order comparator with a function that extracts an int sort key.

ThenComparingLong(IToLongFunction)

Returns a lexicographic-order comparator with a function that extracts a long sort key.

UnregisterFromRuntime() (Inherited from IJavaPeerable)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to