import java.util.*;
public final class Sort {
private Sort(){};
private static void swap(Vector v,int i, int j) {
Object o1 = v.elementAt(i);
Object o2 = v.elementAt(j);
v.setElementAt(o2,i);
v.setElementAt(o1,j);
}
public static void bubble(Vector v) {
for (int i = v.size();
--i>=0; ) {
boolean swapped = false;
for (int j = 0; j<i; j++) {
Comparator c1 = (Comparator)
v.elementAt(j);
Comparator c2 = (Comparator)
v.elementAt(j+1);
int c = c1.compare(c1,c2);
if (c > 0)
swap(v,j,j+1);
}
}
}
}
Kahindu