A comparison function which imposes a
total ordering on some collection of elements. Comparators can be passed to a sort method (such as
org.apache.mahout.math.Sorting.quickSort) to allow precise control over the sort order.
Note: It is generally a good idea for comparators to implement java.io.Serializable, as they may be used as ordering methods in serializable data structures. In order for the data structure to serialize successfully, the comparator (if provided) must implement Serializable.
@see java.util.Comparator
@see org.apache.mahout.math.Sorting