I'd like to know if you know a way to sort an ArrayList of arrays in Java. I have a function that gives a score between 0 and 1 to a specific array. And I'd like to sort the ArrayList so that arrays having the highest score come first.
public double evaluate(int[] toEvaluate) {
double result = 0.0;
for (int i = 0; i < toEvaluate.length; i++) {
result += table[i][casesMap.get(toEvaluate[i])];
}
return result / toEvaluate.length;
}
Any ideas ?