Package-level declarations
Helper functions for creating Comparator instances.
Functions
Creates a comparator using the sequence of functions to calculate a result of comparison. The functions are called sequentially, receive the given values a
and b
and return Comparable objects. As soon as the Comparable instances returned by a function for a
and b
values do not compare as equal, the result of that comparison is returned from the Comparator.
Creates a comparator using the function to transform value to a Comparable instance for comparison.
Creates a comparator using the selector function to transform values being compared and then applying the specified comparator to compare transformed values.
Creates a descending comparator using the function to transform value to a Comparable instance for comparison.
Creates a descending comparator using the selector function to transform values being compared and then applying the specified comparator to compare transformed values.
Compares two nullable Comparable values. Null is considered less than any value.
Compares two values using the specified functions selectors to calculate the result of the comparison. The functions are called sequentially, receive the given values a and b and return Comparable objects. As soon as the Comparable instances returned by a function for a and b values do not compare as equal, the result of that comparison is returned.
Compares two values using the specified selector function to calculate the result of the comparison. The function is applied to the given values a and b and return Comparable objects. The result of comparison of these Comparable instances is returned.
Compares two values using the specified selector function to calculate the result of the comparison. The function is applied to the given values a and b and return objects of type K which are then being compared with the given comparator.
Returns a comparator that compares Comparable objects in natural order.
Provides a comparator of nullable Comparable values considering null
value less than any other value.
Extends the given comparator of non-nullable values to a comparator of nullable values considering null
value less than any other value.
Provides a comparator of nullable Comparable values considering null
value greater than any other value.
Extends the given comparator of non-nullable values to a comparator of nullable values considering null
value greater than any other value.
Returns a comparator that imposes the reverse ordering of this comparator.
Returns a comparator that compares Comparable objects in reversed natural order.
Combines this comparator and the given comparator such that the latter is applied only when the former considered values equal.
Creates a comparator comparing values after the primary comparator defined them equal. It uses the function to transform value to a Comparable instance for comparison.
Creates a comparator comparing values after the primary comparator defined them equal. It uses the selector function to transform values and then compares them with the given comparator.
Creates a descending comparator using the primary comparator and the function to transform value to a Comparable instance for comparison.
Creates a descending comparator comparing values after the primary comparator defined them equal. It uses the selector function to transform values and then compares them with the given comparator.
Creates a comparator using the primary comparator and function to calculate a result of comparison.
Combines this comparator and the given comparator such that the latter is applied only when the former considered values equal.