|
APTCONVERT 1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.pixware.util.QuickSort
public class QuickSort
A quick sort function (static method). The objects to be compared (example:
String) are not required to implement a specific interface (example: Comparable
). Instead the following design was chosen: the quick
sort function is passed a comparator (example: StringCompare), an object
which implements inner interface QuickSort.Compare
.
Nested Class Summary | |
---|---|
static interface |
QuickSort.Compare
Interface implemented by comparators, that is, objects able to compare two objects. |
static class |
QuickSort.StringCompare
The class of String comparators. |
Field Summary | |
---|---|
static QuickSort.StringCompare |
stringCompare
An instance of StringCompare. |
Constructor Summary | |
---|---|
QuickSort()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
Simple test. |
static void |
sort(java.lang.Object[] values,
int first,
int last,
QuickSort.Compare compare)
Sorts a slice in an array of objects. |
static void |
sort(java.lang.Object[] values,
QuickSort.Compare compare)
Sorts an array of objects. |
static void |
sort(java.lang.String[] strings)
Sorts an array of Strings lexicographically. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static QuickSort.StringCompare stringCompare
Constructor Detail |
---|
public QuickSort()
Method Detail |
---|
public static void sort(java.lang.String[] strings)
strings
- the array of Strings to be sortedpublic static void sort(java.lang.Object[] values, QuickSort.Compare compare)
values
- the array of Objects to be sortedcompare
- the Object comparatorpublic static void sort(java.lang.Object[] values, int first, int last, QuickSort.Compare compare)
values
- the array of Objects to be sortedfirst
- position of first object of the slicelast
- position of last object of the slicecompare
- the Object comparatorpublic static void main(java.lang.String[] args)
|
APTCONVERT 1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |