# Comparator

open class Comparator<T> : Comparator<T> (source)

A comparator implementation based on the names returned by the given namer.

#### Parameters

<T>

The type of object that the namer can name

## Constructors

Comparator
Link copied to clipboard
constructor(namer: Namer<in T>)

## Functions

compare
Link copied to clipboard
open fun compare(o1: T, o2: T): Int
comparing
Link copied to clipboard
open fun <T, U> comparing(p: (in T) -> out U, p1: Comparator<in U>): Comparator<T>
comparingDouble
Link copied to clipboard
open fun <T> comparingDouble(p: ToDoubleFunction<in T>): Comparator<T>
comparingInt
Link copied to clipboard
open fun <T> comparingInt(p: ToIntFunction<in T>): Comparator<T>
comparingLong
Link copied to clipboard
open fun <T> comparingLong(p: ToLongFunction<in T>): Comparator<T>
equals
Link copied to clipboard
open fun equals(obj: Any): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
naturalOrder
Link copied to clipboard
open fun <T : Comparable<in T>?> naturalOrder(): Comparator<T>
nullsFirst
Link copied to clipboard
open fun <T> nullsFirst(p: Comparator<in T>): Comparator<T>
nullsLast
Link copied to clipboard
open fun <T> nullsLast(p: Comparator<in T>): Comparator<T>
reversed
Link copied to clipboard
open fun reversed(): Comparator<T>
reverseOrder
Link copied to clipboard
open fun <T : Comparable<in T>?> reverseOrder(): Comparator<T>
thenComparing
Link copied to clipboard
open fun thenComparing(p: Comparator<in T>): Comparator<T>
thenComparingDouble
Link copied to clipboard
open fun thenComparingDouble(p: ToDoubleFunction<in T>): Comparator<T>
thenComparingInt
Link copied to clipboard
open fun thenComparingInt(p: ToIntFunction<in T>): Comparator<T>
thenComparingLong
Link copied to clipboard
open fun thenComparingLong(p: ToLongFunction<in T>): Comparator<T>