8343125: Correct the documentation for TreeMap's getFloorEntry and getCeilingEntry

Reviewed-by: liach, acobbs
This commit is contained in:
Naman Nigam 2024-11-18 18:30:24 +00:00 committed by Chen Liang
parent c59adf68d9
commit e9e4200a6a

View File

@ -420,10 +420,9 @@ public class TreeMap<K,V>
} }
/** /**
* Gets the entry corresponding to the specified key; if no such entry * Returns the entry for the least key greater than or equal to the specified key;
* exists, returns the entry for the least key greater than the specified * if no such entry exists (i.e. the specified key is greater than any key in the tree,
* key; if no such entry exists (i.e., the greatest key in the Tree is less * or the tree is empty), returns {@code null}.
* than the specified key), returns {@code null}.
*/ */
final Entry<K,V> getCeilingEntry(K key) { final Entry<K,V> getCeilingEntry(K key) {
Entry<K,V> p = root; Entry<K,V> p = root;
@ -453,10 +452,9 @@ public class TreeMap<K,V>
} }
/** /**
* Gets the entry corresponding to the specified key; if no such entry * Returns the entry for the greatest key less than or equal to the specified key;
* exists, returns the entry for the greatest key less than the specified * if no such entry exists (i.e. the specified key is less than any key in the tree,
* key; if no such entry exists (i.e., the least key in the Tree is greater * or the tree is empty), returns {@code null}.
* than the specified key), returns {@code null}.
*/ */
final Entry<K,V> getFloorEntry(K key) { final Entry<K,V> getFloorEntry(K key) {
Entry<K,V> p = root; Entry<K,V> p = root;