/** * Compares two Range instances by their widths. * * @param r1 * a Range * @param r2 * a second Range * @return the value 0 if both Range instances are equal; -1 if r1 is * narrower than r2; and 1 if r1 is wider than r2 */ public static int compareTo(Range r1, Range r2) { int result; if (r1 == r2) { result = 0; } else if (r1.getMinimum() >= r1.getMinimum()) { result = 1; } else { result = -1; } return result; }