|
Oracle Data-aware Controls Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.dacf.util.AbstractSort | +--oracle.dacf.util.QuickSort
This is a generic version of C.A.R Hoare's Quick Sort
algorithm. This will handle arrays that are already
sorted, and arrays with duplicate keys.
If you think of a one dimensional array as going from
the lowest index on the left to the highest index on the right
then the parameters to this function are lowest index or
left and highest index or right. The first time you call
this function it will be with the parameters 0, a.length - 1.
You will need to define a comparison method using the Compare interface
and set the comparer before calling sort. If this is not done, then
an IllegalArgumentException will be thrown.
A default swapper is implemented so that it is not necessary to define an
instance of the Swapper interface.
Compare
,
Swapper
,
AbstractSort
Fields inherited from class oracle.dacf.util.AbstractSort |
comparer, swapper |
Constructor Summary | |
QuickSort()
|
Method Summary | |
void |
sort(java.lang.Object[] a)
Sorts the items. |
Methods inherited from class oracle.dacf.util.AbstractSort |
getComparer, getSwapper, setComparer, setSwapper |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QuickSort()
Method Detail |
public void sort(java.lang.Object[] a)
sort
in class AbstractSort
a
- the array of objects to be sorted.java.lang.IllegalArgumentException
- if the comparer is not defined
|
Oracle Data-aware Controls Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |