- interface Sortable(T) : Dispenser!(T) ¶#
-
Sortable is a mixin interface for MutableCollections
supporting a sort method that accepts
a user-supplied Comparator with a compare method that
accepts any two Objects and returns -1/0/+1 depending on whether
the first is less than, equal to, or greater than the second.
After sorting, but in the absence of other mutative operations,
Sortable Collections guarantee that enumerations
appear in sorted order; that is if a and b are two elements
obtained in succession from nextElement(), that
comparator(a, b) <= 0.
Doug Lea
@version 0.93
For an introduction to this package see Overview .
- void sort(Comparator!(T) cmp) [public] ¶#
-
Sort the current elements with respect to cmp.compare.