Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Compares two <code>Range</code> 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement