/** * Instances that have the same runtime, calendarPeriod and coordinates are equal * * @param tother compare this TimeCoord's data * @return true if data are equal */ public boolean equalsData(TimeCoord tother) { // LOOK could speed up by using a hashcode - still have to compare coords if true, however if (!runDate.equals(tother.runDate)) return false; if (!calendarPeriod.equals(tother.calendarPeriod)) return false; if (isInterval() != tother.isInterval()) return false; if (isInterval()) { if (intervals.size() != tother.intervals.size()) return false; for (int i = 0; i < intervals.size(); i++) { if (!(intervals.get(i).equals(tother.intervals.get(i)))) return false; } return true; } else { if (coords.size() != tother.coords.size()) return false; for (int i = 0; i < coords.size(); i++) { if (!(coords.get(i).equals(tother.coords.get(i)))) return false; } return true; } }
if (timeUnitPeriod.equals(CalendarPeriod.Hour)) return range;