8 * A custom quick sort with support to customize the swap behaviour.
9 * NOTICE: We can't use the the sorting support from the JDK 1.2 collection
10 * classes because of the JDK 1.1.7 compatibility.
11 * {@hide} - Not needed for 1.0 SDK
14 public static interface Swapper {
15 public void swap(Vector values, int left, int right);
18 public static void sortStrings(Vector values , int left, int right, Swapper swapper) {
21 String mid= (String)values.elementAt((left + right) / 2);
23 while (((String)(values.elementAt(left))).compareTo(mid) < 0)
25 while (mid.compareTo((String)(values.elementAt(right))) < 0)
28 swapper.swap(values, left, right);
32 } while (left <= right);
35 sortStrings(values, oleft, right, swapper);
37 sortStrings(values, left, oright, swapper);