93 |
|
* Acts as |
94 |
|
* <pre> |
95 |
|
* if ((map.containsKey(key)) { |
96 |
< |
* map.put(key, value); |
97 |
< |
* return true; |
98 |
< |
* } else return false; |
96 |
> |
* return map.put(key, value); |
97 |
> |
* } else return null; |
98 |
|
* </pre> |
99 |
|
* except that the action is performed atomically. |
100 |
|
* @param key key with which the specified value is associated. |
101 |
|
* @param value value to be associated with the specified key. |
102 |
< |
* @return true if the value was replaced |
102 |
> |
* @return previous value associated with specified key, or <tt>null</tt> |
103 |
> |
* if there was no mapping for key. A <tt>null</tt> return can |
104 |
> |
* also indicate that the map previously associated <tt>null</tt> |
105 |
> |
* with the specified key, if the implementation supports |
106 |
> |
* <tt>null</tt> values. |
107 |
|
* @throws NullPointerException if this map does not permit <tt>null</tt> |
108 |
|
* keys or values, and the specified key or value is |
109 |
|
* <tt>null</tt>. |
110 |
|
*/ |
111 |
< |
boolean replace(K key, V value); |
111 |
> |
V replace(K key, V value); |
112 |
|
|
113 |
|
} |