|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.melati.poem.util.SortUtils
public final class SortUtils
An assortment of useful sorting operations.
Method Summary | |
---|---|
static void |
insertionSort(Order cmp,
Object[] arr)
Sort an Array by a supplied ordering. |
static void |
qsort(Order cmp,
Object[] arr)
Quick sort an array. |
static Object[] |
sorted(Order cmp,
Enumeration e)
Sort an Enumeration into an Array. |
static Object[] |
sorted(Order cmp,
Object[] arr)
Return a new sorted Array. |
static Object[] |
sorted(Order cmp,
Vector v)
Sort a Vector into a new Array. |
static void |
swap(Object[] arr,
int i,
int j)
Swap two elements of an Array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void swap(Object[] arr, int i, int j)
arr
- the Arrayi
- will become jj
- will become ipublic static void insertionSort(Order cmp, Object[] arr)
cmp
- an orderingarr
- the Array to sortpublic static void qsort(Order cmp, Object[] arr)
cmp
- ordering to usearr
- Array to sortpublic static Object[] sorted(Order cmp, Object[] arr)
cmp
- the orderingarr
- the Array to sort
public static Object[] sorted(Order cmp, Vector v)
cmp
- the orderingv
- Vector to sort
public static Object[] sorted(Order cmp, Enumeration e)
cmp
- the orderinge
- the Enumeration to sort
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |