|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SortObject
Algorithm interface for sorting a sequence according to a given comparator of elements. All sorting algorithms are expected to modify the Sequence passed in as a parameter (no new Sequence is returned). No guarantee is made that the Position-element binding is preserved, or even that positions and their decorations are preserved.
If the comparator encounters an element which it is unable to compare, a ClassCastException will be thrown, as is documented in the EqualityComparator and Comparator interfaces in nz.ac.waikato.jdsl.core.api.
Running times (time complexities) given for individual algorithms depend on the assumption that the comparator can compare two elements in constant time.
Method Summary | |
---|---|
void |
sort(Sequence s,
Comparator c)
Method that actually sorts the sequence, with the first element after the sort being the one that the comparator reported was smallest. |
Method Detail |
---|
void sort(Sequence s, Comparator c)
s
- sequence to be sortedc
- comparator which defines in which order S is sorted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |