|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.util.SortUtil
public class SortUtil
Quick and merge sort implementations that create no garbage, unlike Arrays.sort(long[])
. The merge sort is stable, the quick sort is not.
Constructor Summary | |
---|---|
SortUtil()
|
Method Summary | |
---|---|
static void |
msort(java.lang.Object[] src,
java.lang.Object[] dest,
java.util.Comparator comp)
Merge sorts the supplied array using the specified comparator. |
static void |
msort(java.lang.Object[] src,
java.lang.Object[] dest,
int low,
int high,
java.util.Comparator comp)
Merge sorts the supplied array using the specified comparator. |
protected static void |
msort(java.lang.Object[] src,
java.lang.Object[] dest,
int low,
int high,
int offset,
java.util.Comparator comp)
Implements the actual merge sort. |
static void |
qsort(int[] a,
int lo0,
int hi0,
java.util.Comparator comp)
|
static void |
qsort(java.lang.Object[] a,
java.util.Comparator comp)
Quick sorts the supplied array using the specified comparator. |
static void |
qsort(java.lang.Object[] a,
int lo0,
int hi0,
java.util.Comparator comp)
Quick sorts the supplied array using the specified comparator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SortUtil()
Method Detail |
---|
public static void qsort(java.lang.Object[] a, java.util.Comparator comp)
public static void qsort(java.lang.Object[] a, int lo0, int hi0, java.util.Comparator comp)
lo0
- the index of the lowest element to include in the sort.hi0
- the index of the highest element to include in the sort.public static void qsort(int[] a, int lo0, int hi0, java.util.Comparator comp)
public static void msort(java.lang.Object[] src, java.lang.Object[] dest, java.util.Comparator comp)
src
- contains the elements to be sorted.dest
- must contain the same values as the src array.public static void msort(java.lang.Object[] src, java.lang.Object[] dest, int low, int high, java.util.Comparator comp)
src
- contains the elements to be sorted.dest
- must contain the same values as the src array.protected static void msort(java.lang.Object[] src, java.lang.Object[] dest, int low, int high, int offset, java.util.Comparator comp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |