|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.uva.vlet.util.QSort
public class QSort
Implements QuickSort, on an array of objects. An implementor of `Comparer' is passed in to compare two objects.
Nested Class Summary | |
---|---|
static class |
QSort.VAttributeComparer
|
static class |
QSort.VNodeComparer
|
Constructor Summary | |
---|---|
QSort(Comparer c)
Create a QSort object. |
Method Summary | |
---|---|
int[] |
sort(int[] mapping,
java.lang.Object[] list,
int start,
int end)
Sorts a subsequence of the array, according to the Comparer. |
int[] |
sort(int[] mapping,
java.util.Vector list,
int start,
int end)
Sorts a subsequence of the array, according to the Comparer. |
int[] |
sort(java.lang.Object[] list)
Sorts the array, according to the Comparer. |
int[] |
sort(java.util.Vector list)
Sorts the array, according to the Comparer. |
static void |
sortVAttributes(VAttribute[] attrs)
|
static void |
sortVNodes(VNode[] nodes,
boolean typeFirst,
boolean ignoreCase)
Sort by name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QSort(Comparer c)
QSort sorter = new QSort(new Comparer() { public int compare(Object a,Object b) { if (a.key == b.key) return 0; else if (a.key < b.key) return -1 else return 1; } }); sorter.sort(array);
Method Detail |
---|
public int[] sort(java.lang.Object[] list)
public int[] sort(java.util.Vector list)
public int[] sort(int[] mapping, java.lang.Object[] list, int start, int end)
public int[] sort(int[] mapping, java.util.Vector list, int start, int end)
public static void sortVAttributes(VAttribute[] attrs)
public static void sortVNodes(VNode[] nodes, boolean typeFirst, boolean ignoreCase)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |