JAL-3401 JAL-3253-applet
[jalview.git] / src / intervalstore / nonc / IntervalComparator.java
1 package intervalstore.nonc;
2
3 import java.util.Comparator;
4
5 import intervalstore.api.IntervalI;
6
7 public class IntervalComparator implements Comparator<IntervalI>
8 {
9
10   @Override
11   public int compare(IntervalI o1, IntervalI o2)
12   {
13     int order = Integer.compare(o1.getBegin(), o2.getBegin());
14     return (order == 0 ? Integer.compare(o2.getEnd(), o1.getEnd()) : order);
15   }
16
17 }