Product Site

5.4.5.1.1. compare

Returns -1 if second is larger than first, 0 if the two objects are equal, and 1 if second is smaller than first.

The default Comparator compare method assumes that first is an object that implements the Comparable compareTo method. Subclasses may override this to implement more specific comparisons.

Example 5.220. Comparator class
wine = .Array~of("Strawberries", "cherries", "angel's kiss")
wine~sortWith(.Comparator~new)         -- Strawberries, angel's kiss, cherries