comparator library

Provides default Comparator constructors, and various static extension methods to modify and perform common operations on Comparator functions.

Mixins

CompareOperators<T>
A generic mixin that provides standard comparison operators like <, <=, >= and > provided the class is Comparable.

Functions

explicitComparator<T>(Iterable<T> iterable) Comparator<T>
Returns an explicit Comparator based on an iterable of elements.
naturalComparable<T extends Comparable<T>>(T a, T b) int
Natural static Comparator function using Comparable arguments.
naturalComparator<T>() Comparator<T>
Returns a natural Comparator for objects of type T.
naturalCompare(Object? a, Object? b) int
Natural dynamic Comparator function.
reverseComparable<T extends Comparable<T>>(T a, T b) int
Reversed static Comparator function using Comparable arguments.
reverseComparator<T>() Comparator<T>
Returns a reversed Comparator for objects of type T.
reverseCompare(Object? a, Object? b) int
Reversed dynamic Comparator function.