MCPcopy Create free account
hub / github.com/apache/groovy / containsWithinBounds

Method containsWithinBounds

src/main/java/groovy/lang/NumberRange.java:460–468  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

compareToMethod · 0.45

Tested by

no test coverage detected