3 import java.util.Comparator;
6 * A comparator to order [from, to] ranges into ascending or descending order of
9 public class RangeComparator implements Comparator<int[]>
13 public RangeComparator(boolean forward)
19 public int compare(int[] o1, int[] o2)
21 int compared = Integer.compare(o1[0], o2[0]);
22 return forwards ? compared : -compared;