(K endKey)
| 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() { |
nothing calls this directly
no test coverage detected