Package VASSAL.tools
Class Sort
java.lang.Object
VASSAL.tools.Sort
Deprecated.
Use {link java.util.Collections.sort} instead.
Quicksort implementation so we can sort using JRE 1.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Deprecated.Use the natural ordering on Strings instead.static interface
Deprecated.UseComparator
instead. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
quicksort(Vector<Object> v, Sort.Comparator comp)
Deprecated.Quicksort will rearrange elements when they are all equal.
-
Constructor Details
-
Sort
public Sort()Deprecated.
-
-
Method Details
-
quicksort
Deprecated.Quicksort will rearrange elements when they are all equal. Make sure at least two elements differ public static boolean needsSorting(Vector v) { IComparable prev = null; IComparable curr; for (Enumeration e = v.elements(); e.hasMoreElements(); ) { curr = (IComparable)e.nextElement(); if (prev != null && prev.compareTo(curr) != 0) return true; prev = curr; } return false; }
-