1 package intervalstore.nonc;
3 import java.util.Comparator;
5 import intervalstore.api.IntervalI;
7 public class IntervalComparator implements Comparator<IntervalI>
11 public int compare(IntervalI o1, IntervalI o2)
13 int order = Integer.compare(o1.getBegin(), o2.getBegin());
14 return (order == 0 ? Integer.compare(o2.getEnd(), o1.getEnd()) : order);