2269 |
|
* <tt>null</tt>. |
2270 |
|
*/ |
2271 |
|
public SortedMap<K,V> subMap(K fromKey, K toKey) { |
2272 |
< |
if (fromKey == null || toKey == null) |
2273 |
< |
throw new NullPointerException(); |
2274 |
< |
return new ConcurrentSkipListSubMap(this, fromKey, toKey); |
2272 |
> |
return navigableSubMap(fromKey, toKey); |
2273 |
|
} |
2274 |
|
|
2275 |
|
/** |
2285 |
|
* @throws NullPointerException if <tt>toKey</tt> is <tt>null</tt>. |
2286 |
|
*/ |
2287 |
|
public SortedMap<K,V> headMap(K toKey) { |
2288 |
< |
if (toKey == null) |
2291 |
< |
throw new NullPointerException(); |
2292 |
< |
return new ConcurrentSkipListSubMap(this, null, toKey); |
2288 |
> |
return navigableHeadMap(toKey); |
2289 |
|
} |
2290 |
|
|
2291 |
|
/** |
2301 |
|
* @throws NullPointerException if <tt>fromKey</tt> is <tt>null</tt>. |
2302 |
|
*/ |
2303 |
|
public SortedMap<K,V> tailMap(K fromKey) { |
2304 |
< |
if (fromKey == null) |
2309 |
< |
throw new NullPointerException(); |
2310 |
< |
return new ConcurrentSkipListSubMap(this, fromKey, null); |
2304 |
> |
return navigableTailMap(fromKey); |
2305 |
|
} |
2306 |
|
|
2307 |
|
/* ---------------- Relational operations -------------- */ |