(K startKey, K endKey)
| 880 | } |
| 881 | |
| 882 | public SortedMap<K, V> subMap(K startKey, K endKey) { |
| 883 | checkRange(startKey); |
| 884 | Comparator<? super K> cmp = backingMap.comparator; |
| 885 | if (cmp == null) { |
| 886 | java.lang.Comparable<K> object = toComparable(endKey); |
| 887 | if (hasStart && object.compareTo(startKey) < 0) { |
| 888 | throw new IllegalArgumentException(); |
| 889 | } |
| 890 | if (hasEnd && object.compareTo(endKey) > 0) { |
| 891 | throw new IllegalArgumentException(); |
| 892 | } |
| 893 | } else { |
| 894 | if (hasStart |
| 895 | && backingMap.comparator().compare(endKey, this.startKey) < 0) { |
| 896 | throw new IllegalArgumentException(); |
| 897 | } |
| 898 | if (hasEnd && backingMap.comparator().compare(endKey,this.endKey) > 0) { |
| 899 | throw new IllegalArgumentException(); |
| 900 | } |
| 901 | } |
| 902 | Comparator<? super K> c = backingMap.comparator(); |
| 903 | if (c == null) { |
| 904 | if (toComparable(startKey).compareTo(endKey) <= 0) { |
| 905 | return new SubMap<K, V>(startKey, backingMap, endKey); |
| 906 | } |
| 907 | } else { |
| 908 | if (c.compare(startKey, endKey) <= 0) { |
| 909 | return new SubMap<K, V>(startKey, backingMap, endKey); |
| 910 | } |
| 911 | } |
| 912 | throw new IllegalArgumentException(); |
| 913 | } |
| 914 | |
| 915 | public SortedMap<K, V> tailMap(K startKey) { |
| 916 | checkRange(startKey); |
nothing calls this directly
no test coverage detected