88 |
|
*/ |
89 |
|
boolean replace(K key, V oldValue, V newValue); |
90 |
|
|
91 |
+ |
/** |
92 |
+ |
* Replace entry for key only if currently mapped to some value. |
93 |
+ |
* Acts as |
94 |
+ |
* <pre> |
95 |
+ |
* if ((map.containsKey(key)) { |
96 |
+ |
* map.put(key, value); |
97 |
+ |
* return true; |
98 |
+ |
* } else return false; |
99 |
+ |
* </pre> |
100 |
+ |
* except that the action is performed atomically. |
101 |
+ |
* @param key key with which the specified value is associated. |
102 |
+ |
* @param value value to be associated with the specified key. |
103 |
+ |
* @return true if the value was replaced |
104 |
+ |
* @throws NullPointerException if this map does not permit <tt>null</tt> |
105 |
+ |
* keys or values, and the specified key or value is |
106 |
+ |
* <tt>null</tt>. |
107 |
+ |
*/ |
108 |
+ |
boolean replace(K key, V value); |
109 |
+ |
|
110 |
|
} |