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

Method containsWithinBounds

src/main/java/groovy/lang/IntRange.java:407–417  ·  view source on GitHub ↗

{@inheritDoc}

(Object o)

Source from the content-addressed store, hash-verified

405 * {@inheritDoc}
406 */
407 @Override
408 public boolean containsWithinBounds(Object o) {
409 // unlike contains(), this checks the continuous interval between the
410 // boundary values, so a non-integer value within [from, to] qualifies
411 if (o instanceof Number) {
412 Comparable value = (Comparable) o;
413 return DefaultGroovyMethods.numberAwareCompareTo(value, getFrom()) >= 0
414 && DefaultGroovyMethods.numberAwareCompareTo(value, getTo()) <= 0;
415 }
416 return contains(o);
417 }
418
419 /**
420 * {@inheritDoc}

Callers

nothing calls this directly

Calls 4

numberAwareCompareToMethod · 0.95
getFromMethod · 0.95
getToMethod · 0.95
containsMethod · 0.95

Tested by

no test coverage detected