List of utility methods to do Vector Sort
Vector | sort(Vector unsorted, int sortKeyPos, int maxVal) Sorts the elements of a Vector. int listSize = unsorted.size(); Vector sorted = (Vector) unsorted.clone(); int[] map = new int[maxVal]; int index = -1; for (int i = 0; i < listSize; i++) { index = ((Integer) (((Object[]) unsorted.elementAt(i))[sortKeyPos])).intValue(); if (index > maxVal) throw new IllegalArgumentException("Incorrect maxVal"); ... |
void | sortInsert(Vector v, Object obj) sort Insert Enumeration e = v.elements(); for (int i = 0; i < v.size(); i++) { Object cur = v.elementAt(i); if (obj.toString().compareTo(cur.toString()) < 0) { v.insertElementAt(obj, i); return; v.addElement(obj); |
Vector | sortIntegerVector(Vector toSort) Sorts an if (toSort == null) { return new Vector(); int size = toSort.size(); if (size == 0) { return toSort; Vector sorted = new Vector(); ... |