Removed reference to 1.5-specific Collections; fixed ArrayList override.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1818 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2006-04-11 04:06:32 +00:00
parent 9a3d1f1672
commit 333ec4c439
3 changed files with 12 additions and 4 deletions
@@ -50,7 +50,11 @@ public class ComparableArrayList<T extends Comparable<? super T>>
*/
public void rsort ()
{
sort(java.util.Collections.reverseOrder(_comp));
sort(new Comparator<T>() {
public int compare (T o1, T o2) {
return _comp.compare(o2, o1);
}
});
}
/**
@@ -137,7 +137,7 @@ public class ObserverList<T> extends ArrayList<T>
}
// documentation inherited
public void add (int index, Object element)
public void add (int index, T element)
{
throw new UnsupportedOperationException(UNSUPPORTED_ADD_MESSAGE);
}
+6 -2
View File
@@ -385,9 +385,13 @@ public class QuickSort
* Sort the elements in the specified ArrayList according to the
* reverse ordering imposed by the specified Comparator.
*/
public static <T> void rsort (ArrayList<T> a, Comparator<T> comp)
public static <T> void rsort (ArrayList<T> a, final Comparator<T> comp)
{
sort(a, java.util.Collections.reverseOrder(comp));
sort(a, new Comparator<T>() {
public int compare (T o1, T o2) {
return comp.compare(o2, o1);
}
});
}
/**