1066 |
|
} |
1067 |
|
|
1068 |
|
public boolean containsKey(Object key) { |
1069 |
< |
return inRange((K) key) && TreeMap.this.containsKey(key); |
1069 |
> |
return inRange(key) && TreeMap.this.containsKey(key); |
1070 |
|
} |
1071 |
|
|
1072 |
|
public V get(Object key) { |
1073 |
< |
if (!inRange((K) key)) |
1073 |
> |
if (!inRange(key)) |
1074 |
|
return null; |
1075 |
|
return TreeMap.this.get(key); |
1076 |
|
} |
1082 |
|
} |
1083 |
|
|
1084 |
|
public V remove(Object key) { |
1085 |
< |
if (!inRange((K) key)) |
1085 |
> |
if (!inRange(key)) |
1086 |
|
return null; |
1087 |
|
return TreeMap.this.remove(key); |
1088 |
|
} |
1351 |
|
return navigableTailMap(fromKey); |
1352 |
|
} |
1353 |
|
|
1354 |
< |
private boolean inRange(K key) { |
1354 |
> |
private boolean inRange(Object key) { |
1355 |
|
return (fromStart || compare(key, fromKey) >= 0) && |
1356 |
|
(toEnd || compare(key, toKey) < 0); |
1357 |
|
} |
1358 |
|
|
1359 |
|
// This form allows the high endpoint (as well as all legit keys) |
1360 |
< |
private boolean inRange2(K key) { |
1360 |
> |
private boolean inRange2(Object key) { |
1361 |
|
return (fromStart || compare(key, fromKey) >= 0) && |
1362 |
|
(toEnd || compare(key, toKey) <= 0); |
1363 |
|
} |