All pastes #954353 Raw Edit

Mine

public java v1 · immutable
#954353 ·published 2008-03-23 21:05 UTC
rendered paste body
package org.wreckage.gss;public class TimesheetLineByDateComparator<TimesheetLine>                implements java.util.Comparator<TimesheetLine> {        public int compare(TimesheetLine l1, TimesheetLine l2) {                // OK, we know that all the lines that get to here have a date and a contact                int dateComparison = l1.getDate().compareTo(l2.getDate());                if (dateComparison == 0) {                        if (l1.equals(l2))                                return 0;                        else                                return l1.getId() < l2.getId() ? -1 : 1;                } else                        return dateComparison < 0 ? -10 : 10;        }}