Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
timronan committed Jan 9, 2019
2 parents f3b1ad4 + dd0b688 commit 8a151d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/edu/iris/dmc/TimeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,8 @@ public static boolean isBefore(XMLGregorianCalendar one, XMLGregorianCalendar tw
}

public static int compare(XMLGregorianCalendar one, XMLGregorianCalendar two) {
if (one.toGregorianCalendar().before(two)) {
return -1;
}

if (one.toGregorianCalendar().after(two)) {
return 1;
}
int result = one.toGregorianCalendar().compareTo(two.toGregorianCalendar());
return result;

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private List<Tuple[]> checkRanges(List<Tuple> tuples) {
Tuple tuple1 = tuples.get(i - 1);
Tuple tuple2 = tuples.get(i);
if (tuple1.end == null || tuple2.start == null || TimeUtil.isAfter(tuple1.end, tuple2.start)) {
System.out.println(tuple1+" "+tuple2+" "+TimeUtil.isAfter(tuple1.end, tuple2.start));
overlappingDatePairs.add(new Tuple[] { tuple1, tuple2 });
}
}
Expand All @@ -153,6 +154,12 @@ public int compareTo(Tuple other) {
return TimeUtil.compare(start, other.start);
}

@Override
public String toString() {
return "Tuple [code=" + code + ", location=" + location + ", start=" + start + ", end=" + end + ", index="
+ index + "]";
}

}

}

0 comments on commit 8a151d2

Please sign in to comment.