代码段:
public static List sortReports(List myList) {
Collections.sort(myList, new Comparator() {
public int compare(Object obj1, Object obj2) {
ReportUebersichtParameter o1 = (ReportUebersichtParameter) obj1;
ReportUebersichtParameter o2 = (ReportUebersichtParameter) obj2;
int value = o1.getSortCriteria().compareTo(o2.getSortCriteria());
if (-1 == value) {
return 1;
}
if (1 == value) {
return -1;
}
return o1.getTitel().compareTo(o2.getTitel());
}
});
return myList;
}
无法获得解决方案。有人可以帮忙吗?