Sunday, December 21, 2014

I have a List in GWT and I wish to sort it but GWT complains at runtime that it cannot be done.



List<int[]> tuples = new LinkedList<int[]>();
tuples.sort(new TupleComparator());

class TupleComparator implements Comparator<int[]> {

@Override
public int compare(int[] o1, int[] o2) {
int i = 0;
int l = o1.length;
while (i < l && o1[i] == o2[i]) {
i++;
}
return (i == l ? 0 : o1[i] - o2[i]);
}
}

[ERROR] [testgwtlistofint] - Line 116: The method sort(TupleComparator)
is undefined for the type List<int[]>

No comments:

Post a Comment