From df9f08d3160a22680e9e5074d98b80a7678c6c12 Mon Sep 17 00:00:00 2001 From: mdb Date: Mon, 8 Oct 2007 15:17:34 +0000 Subject: [PATCH] Per Mike T: we may want to create an array list of type B and then sort it using a comparator on type A which is a superclass of B. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2230 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/SortableArrayList.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/com/samskivert/util/SortableArrayList.java b/src/java/com/samskivert/util/SortableArrayList.java index c38e1c9d..c1e1a6b4 100644 --- a/src/java/com/samskivert/util/SortableArrayList.java +++ b/src/java/com/samskivert/util/SortableArrayList.java @@ -39,7 +39,7 @@ public class SortableArrayList extends BaseArrayList * any object allocation). The elements must all be mutually * comparable. */ - public void sort (Comparator comp) + public void sort (Comparator comp) { if (_size > 1) { QuickSort.sort(_elements, 0, _size-1, comp); @@ -56,7 +56,7 @@ public class SortableArrayList extends BaseArrayList * @return the index at which the element was inserted. */ @SuppressWarnings("unchecked") - public int insertSorted (T value, Comparator comp) + public int insertSorted (T value, Comparator comp) { int ipos = binarySearch(value, comp); if (ipos < 0) { @@ -76,7 +76,7 @@ public class SortableArrayList extends BaseArrayList * (-(insertion point) - 1) (always a negative * value) if the object was not found in the list. */ - public int binarySearch (T key, Comparator comp) + public int binarySearch (T key, Comparator comp) { return ArrayUtil.binarySearch(_elements, 0, _size, key, comp); }