private static void sortByName(List statusList) {
Collections.sort(statusList, new Comparator() {
public int compare(Object o1, Object o2) {
if (o1 instanceof CrawlerStatus) {
CrawlerStatus stat1 = (CrawlerStatus) o1;
CrawlerStatus stat2 = (CrawlerStatus) o2;
return stat1.getInfo().getCrawlerName()
.compareTo(stat2.getInfo().getCrawlerName());
} else if (o1 instanceof PCSDaemonStatus) {
PCSDaemonStatus stat1 = (PCSDaemonStatus) o1;
PCSDaemonStatus stat2 = (PCSDaemonStatus) o2;
return stat1.getDaemonName().compareTo(stat2.getDaemonName());
} else
return 0;
}
});