You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Benson Margulies <bi...@gmail.com> on 2009/12/23 18:29:01 UTC
[math] API for sorting objects; cleaning up generic usage to avoid
needing to suppress warnings
Current:
public static void quickSort(Object[] a) {
quickSort1(a, 0, a.length);
}
proposed:
public static <T extends Comparable<? super T>> static void quickSort(T[]) {
...
}
The contract is that the objects implement Comparable. I took the
above from Collections.sort.
There are no current callers of this function.
Re: [math] API for sorting objects; cleaning up generic usage to
avoid needing to suppress warnings
Posted by Ted Dunning <te...@gmail.com>.
+1 as well.
On Wed, Dec 23, 2009 at 9:33 AM, Sean Owen <sr...@gmail.com> wrote:
> +1 to that.
>
> On Dec 23, 2009 5:29 PM, "Benson Margulies" <bi...@gmail.com> wrote:
>
> Current:
>
> public static void quickSort(Object[] a) {
> quickSort1(a, 0, a.length);
> }
>
> proposed:
>
> public static <T extends Comparable<? super T>> static void
> quickSort(T[])
> {
> ...
> }
>
> The contract is that the objects implement Comparable. I took the
> above from Collections.sort.
>
>
Re: [math] API for sorting objects; cleaning up generic usage to
avoid needing to suppress warnings
Posted by Sean Owen <sr...@gmail.com>.
+1 to that.
On Dec 23, 2009 5:29 PM, "Benson Margulies" <bi...@gmail.com> wrote:
Current:
public static void quickSort(Object[] a) {
quickSort1(a, 0, a.length);
}
proposed:
public static <T extends Comparable<? super T>> static void quickSort(T[])
{
...
}
The contract is that the objects implement Comparable. I took the
above from Collections.sort.
There are no current callers of this function.