3 import java.util.Comparator;
6 * A comparator to order [from, to] ranges into ascending or descending order of
9 public class IntRangeComparator implements Comparator<int[]>
11 public static final Comparator<int[]> ASCENDING = new IntRangeComparator(
14 public static final Comparator<int[]> DESCENDING = new IntRangeComparator(
19 IntRangeComparator(boolean forward)
25 public int compare(int[] o1, int[] o2)
27 int compared = Integer.compare(o1[0], o2[0]);
28 return forwards ? compared : -compared;