Package VASSAL.tools
Class Sort
java.lang.Object
VASSAL.tools.Sort
Deprecated, for removal: This API element is subject to removal in a future version.
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, for removal: This API element is subject to removal in a future version.Use the natural ordering on Strings instead.static interface
Deprecated, for removal: This API element is subject to removal in a future version.UseComparator
instead. -
Constructor Summary
ConstructorDescriptionSort()
Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
quicksort
(Vector<Object> v, Sort.Comparator comp) Deprecated, for removal: This API element is subject to removal in a future version.Quicksort will rearrange elements when they are all equal.
-
Constructor Details
-
Sort
public Sort()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
quicksort
Deprecated, for removal: This API element is subject to removal in a future version.Quicksort will rearrange elements when they are all equal. Make sure at least two elements differ. Sort using the specified comparator objectpublic 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; }
-