Returns this map's entry for the given key, or null if the map does not contain an entry for the key. @return this map's entry for the given key, or null if the map does not contain an entry for the key. @throws ClassCastException if the key cannot be compared with the key
(Object key)
| 339 | * <tt>null</tt> keys. |
| 340 | */ |
| 341 | private Entry<K,V> getEntry(Object key) { |
| 342 | Entry<K,V> p = root; |
| 343 | while (p != null) { |
| 344 | int cmp = compare(key,p.key); |
| 345 | if (cmp == 0) |
| 346 | return p; |
| 347 | else if (cmp < 0) |
| 348 | p = p.left; |
| 349 | else |
| 350 | p = p.right; |
| 351 | } |
| 352 | return null; |
| 353 | } |
| 354 | |
| 355 | |
| 356 | /** |