MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / checkRange

Method checkRange

Ports/CLDC11/src/java/util/TreeMap.java:502–521  ·  view source on GitHub ↗
(K key)

Source from the content-addressed store, hash-verified

500 }
501
502 private void checkRange(K key) {
503 Comparator<? super K> cmp = backingMap.comparator;
504 if (cmp == null) {
505 java.lang.Comparable<K> object = toComparable(key);
506 if (hasStart && object.compareTo(startKey) < 0) {
507 throw new IllegalArgumentException();
508 }
509 if (hasEnd && object.compareTo(endKey) >= 0) {
510 throw new IllegalArgumentException();
511 }
512 } else {
513 if (hasStart
514 && backingMap.comparator().compare(key, startKey) < 0) {
515 throw new IllegalArgumentException();
516 }
517 if (hasEnd && backingMap.comparator().compare(key, endKey) >= 0) {
518 throw new IllegalArgumentException();
519 }
520 }
521 }
522
523 private boolean isInRange(K key) {
524 Comparator<? super K> cmp = backingMap.comparator;

Callers 2

subMapMethod · 0.95
tailMapMethod · 0.95

Calls 4

compareToMethod · 0.65
compareMethod · 0.65
comparatorMethod · 0.65
toComparableMethod · 0.45

Tested by

no test coverage detected