Package VASSAL.tools
Class Sort
java.lang.Object
VASSAL.tools.Sort
@Deprecated public class Sort extends Object
Deprecated.
Quicksort implementation so we can sort using JRE 1.1
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sort.Alpha
Deprecated.Use the natural ordering on Strings instead.static interface
Sort.Comparator
Deprecated.UseComparator
instead. -
Constructor Summary
Constructors Constructor Description Sort()
Deprecated. -
Method Summary
Modifier and Type Method Description static 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; }
-
java.util.Collections.sort
instead.