this.column = column;
this.ascending = ascending;
}
public int compare(Object o1, Object o2) {
Document d1 = (Document) o1;
Document d2 = (Document) o2;
String l1;
String l2;
int result = 0;
switch (column) {
case 0:
result = d1.getRawName().compareToIgnoreCase(d2.getRawName());
break;
case 1:
String c1 = d1.getPrimaryCategory();
if (c1 == null) {
c1 = "";
}
String c2 = d2.getPrimaryCategory();
if (c2 == null) {
c2 = "";
}
result = c1.compareToIgnoreCase(c2);
break;
case 2:
l1 = Language.getLanguage(d1.getLanguage()).getName();
l2 = Language.getLanguage(d2.getLanguage()).getName();
result = l1.compareTo(l2);
break;
case 3:
if (d1 instanceof Feed && d2 instanceof Site) {
result = -1;