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:
@@ -50,7 +50,11 @@ public class ComparableArrayList<T extends Comparable<? super T>>
|
|||||||
*/
|
*/
|
||||||
public void rsort ()
|
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
|
// documentation inherited
|
||||||
public void add (int index, Object element)
|
public void add (int index, T element)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException(UNSUPPORTED_ADD_MESSAGE);
|
throw new UnsupportedOperationException(UNSUPPORTED_ADD_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -385,9 +385,13 @@ public class QuickSort
|
|||||||
* Sort the elements in the specified ArrayList according to the
|
* Sort the elements in the specified ArrayList according to the
|
||||||
* reverse ordering imposed by the specified Comparator.
|
* 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user