Product Site

5.4.5.5.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, resulting in a descending sort sequence.

The DescendingComparator assumes the first object implements the Comparable compareTo method.

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