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

Method headMap

Ports/CLDC11/src/java/util/TreeMap.java:715–738  ·  view source on GitHub ↗
(K endKey)

Source from the content-addressed store, hash-verified

713 }
714
715 public SortedMap<K, V> headMap(K endKey) {
716 Comparator<? super K> cmp = backingMap.comparator;
717 if (cmp == null) {
718 java.lang.Comparable<K> object = toComparable(endKey);
719 if (hasStart && object.compareTo(startKey) < 0) {
720 throw new IllegalArgumentException();
721 }
722 if (hasEnd && object.compareTo(this.endKey) > 0) {
723 throw new IllegalArgumentException();
724 }
725 } else {
726 if (hasStart
727 && backingMap.comparator().compare(endKey, startKey) < 0) {
728 throw new IllegalArgumentException();
729 }
730 if (hasEnd && backingMap.comparator().compare(endKey, this.endKey) >= 0) {
731 throw new IllegalArgumentException();
732 }
733 }
734 if (hasStart) {
735 return new SubMap<K, V>(startKey, backingMap, endKey);
736 }
737 return new SubMap<K, V>(backingMap, endKey);
738 }
739
740 @Override
741 public boolean isEmpty() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected