MCPcopy Index your code
hub / github.com/davidgiven/luje / checkRange

Method checkRange

lib/java/util/TreeMap.java:394–413  ·  view source on GitHub ↗
(K key)

Source from the content-addressed store, hash-verified

392 }
393
394 private void checkRange(K key) {
395 Comparator<? super K> cmp = backingMap.comparator;
396 if (cmp == null) {
397 Comparable<K> object = toComparable(key);
398 if (hasStart && object.compareTo(startKey) < 0) {
399 throw new IllegalArgumentException();
400 }
401 if (hasEnd && object.compareTo(endKey) > 0) {
402 throw new IllegalArgumentException();
403 }
404 } else {
405 if (hasStart
406 && backingMap.comparator().compare(key, startKey) < 0) {
407 throw new IllegalArgumentException();
408 }
409 if (hasEnd && backingMap.comparator().compare(key, endKey) > 0) {
410 throw new IllegalArgumentException();
411 }
412 }
413 }
414
415 private boolean isInRange(K key) {
416 Comparator<? super K> cmp = backingMap.comparator;

Callers 3

headMapMethod · 0.95
subMapMethod · 0.95
tailMapMethod · 0.95

Calls 4

toComparableMethod · 0.80
compareToMethod · 0.65
compareMethod · 0.65
comparatorMethod · 0.65

Tested by

no test coverage detected