interface Comparator
source · line 7public
public interface Comparator<T>
Defines an ordering: negative means the first value precedes the second, zero means equivalent, and positive means it follows.
Extensions
public fun <T> Comparator<T>.reversed(): Comparator<T>· scoop:scoop.std:0.1.0public fun <T, K> Comparator<T>.thenBy(comparator: Comparator<K>, selector: (T) -> K): Comparator<T>· scoop:scoop.std:0.1.0public fun <T, K : Compare<K>> Comparator<T>.thenBy(selector: (T) -> K): Comparator<T>· scoop:scoop.std:0.1.0
function compare
source · line 11public
public fun compare(left: T, right: T): Long
Compares two values according to this ordering; only the sign of the result matters.
parameter left
source · line 11public
left: T
parameter right
source · line 11public
right: T
type parameter T
source · line 7public
T