MCPcopy Index your code
hub / github.com/apache/groovy / containsWithinBounds

Method containsWithinBounds

src/main/java/groovy/lang/ObjectRange.java:278–285  ·  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

276 * @return true if the value is within the bounds
277 */
278 @Override
279 public boolean containsWithinBounds(Object value) {
280 if (value instanceof Comparable) {
281 final int result = compareTo(from, (Comparable) value);
282 return result == 0 || result < 0 && compareTo(to, (Comparable) value) >= 0;
283 }
284 return contains(value);
285 }
286
287 /**
288 * Compares two values using Groovy's number-aware comparison.

Callers

nothing calls this directly

Calls 2

compareToMethod · 0.95
containsMethod · 0.95

Tested by

no test coverage detected