public int compareTo(ClassTimeInfo time) { int cmp = getDate().compareTo(time.getDate()); if (cmp != 0) return cmp; cmp = getTimePattern().compareTo(time.getTimePattern()); if (cmp != 0) return cmp; cmp = getDayCode() - time.getDayCode(); if (cmp != 0) return cmp; cmp = getStartSlot() - time.getStartSlot(); if (cmp != 0) return cmp; return hashCode() - time.hashCode(); }
public boolean shareWeeks(ClassTimeInfo anotherLocation) { return getDate().getPattern().intersects(anotherLocation.getDate().getPattern()); }