97 |
|
|
98 |
|
/** |
99 |
|
* If the specified key is not already associated |
100 |
< |
* with a value, associate it with the given value. |
101 |
< |
* This is equivalent to |
100 |
> |
* with a value, associates it with the given value. |
101 |
> |
* This is equivalent to, for this {@code map}: |
102 |
|
* <pre> {@code |
103 |
|
* if (!map.containsKey(key)) |
104 |
|
* return map.put(key, value); |
130 |
|
|
131 |
|
/** |
132 |
|
* Removes the entry for a key only if currently mapped to a given value. |
133 |
< |
* This is equivalent to |
133 |
> |
* This is equivalent to, for this {@code map}: |
134 |
|
* <pre> {@code |
135 |
|
* if (map.containsKey(key) && Objects.equals(map.get(key), value)) { |
136 |
|
* map.remove(key); |
160 |
|
|
161 |
|
/** |
162 |
|
* Replaces the entry for a key only if currently mapped to a given value. |
163 |
< |
* This is equivalent to |
163 |
> |
* This is equivalent to, for this {@code map}: |
164 |
|
* <pre> {@code |
165 |
|
* if (map.containsKey(key) && Objects.equals(map.get(key), oldValue)) { |
166 |
|
* map.put(key, newValue); |
191 |
|
|
192 |
|
/** |
193 |
|
* Replaces the entry for a key only if currently mapped to some value. |
194 |
< |
* This is equivalent to |
194 |
> |
* This is equivalent to, for this {@code map}: |
195 |
|
* <pre> {@code |
196 |
|
* if (map.containsKey(key)) { |
197 |
|
* return map.put(key, value); |