}
protected void sort(final String column, final boolean ascending) {
Comparator comparator = new Comparator() {
public int compare(Object o1, Object o2) {
ActivityVO c1 = (ActivityVO) o1;
ActivityVO c2 = (ActivityVO) o2;
if (column == null) {
return 0;
}
if (column.equals("assignedTo")) {
return ascending
? c1.getAssignedTo().compareTo(c2.getAssignedTo())
: c2.getAssignedTo().compareTo(c1.getAssignedTo());
} else if (column.equals("beginDate")) {
return ascending
? c1.getBeginDate().compareTo(c2.getBeginDate())
: c2.getBeginDate().compareTo(c1.getBeginDate());
} else {
return 0;
}
}
};