Checks whether a value is between the from and to values of a Range @param value the value of interest @return true if the value is within the bounds
(Object value)
| 458 | * @return true if the value is within the bounds |
| 459 | */ |
| 460 | @Override |
| 461 | public boolean containsWithinBounds(Object value) { |
| 462 | int result = compareTo(from, value); |
| 463 | if ((reverse ? inclusiveRight : inclusiveLeft) && result == 0) result = -1; |
| 464 | if (result >= 0) return false; |
| 465 | result = compareTo(to, value); |
| 466 | if ((reverse ? inclusiveLeft : inclusiveRight) && result == 0) result = 1; |
| 467 | return result > 0; |
| 468 | } |
| 469 | |
| 470 | /** |
| 471 | * protection against calls from Groovy |