Skip to content

Comparable

1 min read

No import is needed.

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

Comparable

Total order: compare returns negative / zero / positive like strcmp.

public interface Comparable<T>

compare

Returns a negative number, zero, or a positive number for less than, equal to, or greater than other.

fun compare(borrow other: T): int