#include <coherence/util/Arrays.hpp>
Static Public Member Functions | |
static void | sort (ObjectArray::Handle hArray) |
Sorts the specified array of objects into ascending order, according to the natural ordering of its elements. | |
static void | sort (ObjectArray::Handle hArray, Comparator::Handle hComparator) |
Sorts the specified array of objects according to the order induced by the specified comparator. |
static void sort | ( | ObjectArray::Handle | hArray | ) | [static] |
Sorts the specified array of objects into ascending order, according to the natural ordering of its elements.
All elements in the array must implement the Comparable interface. Furthermore, all elements in the array must be mutually comparable.
This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.
hArray | the array to be sorted |
ClassCastException | if the array contains elements that are not mutually comparable |
static void sort | ( | ObjectArray::Handle | hArray, | |
Comparator::Handle | hComparator | |||
) | [static] |
Sorts the specified array of objects according to the order induced by the specified comparator.
All elements in the array must be mutually comparable by the specified comparator.
This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.
hArray | the array to be sorted | |
hComparator | the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used |
ClassCastException | if the array contains elements that are not mutually comparable |