这种有什么问题吗?它不能正常工作。
public List<LibRegistration> getLibraryRegistrationsSortedByTypeAndName()
{
List<LibRegistration> l = getLibRegs();
Collections.sort(l, new Comparator<LibRegistration>() {
public int compare(LibRegistration o1, LibRegistration o2) {
return o1.getLibraryType().compareTo(o2.getLibraryType()) != 0?o1.getLibraryType().compareTo(o2.getLibraryType()):o1.getLibraryName().compareTo(o2.getLibraryName());
}
});
return l;
}