diff options
Diffstat (limited to 'luni/src/main/java/java/util/concurrent/ConcurrentMap.java')
-rw-r--r-- | luni/src/main/java/java/util/concurrent/ConcurrentMap.java | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/luni/src/main/java/java/util/concurrent/ConcurrentMap.java b/luni/src/main/java/java/util/concurrent/ConcurrentMap.java index 2daebc5..3405acf 100644 --- a/luni/src/main/java/java/util/concurrent/ConcurrentMap.java +++ b/luni/src/main/java/java/util/concurrent/ConcurrentMap.java @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ package java.util.concurrent; @@ -32,11 +32,12 @@ public interface ConcurrentMap<K, V> extends Map<K, V> { * If the specified key is not already associated * with a value, associate it with the given value. * This is equivalent to - * <pre> - * if (!map.containsKey(key)) - * return map.put(key, value); - * else - * return map.get(key);</pre> + * <pre> {@code + * if (!map.containsKey(key)) + * return map.put(key, value); + * else + * return map.get(key);}</pre> + * * except that the action is performed atomically. * * @param key key with which the specified value is to be associated @@ -61,11 +62,13 @@ public interface ConcurrentMap<K, V> extends Map<K, V> { /** * Removes the entry for a key only if currently mapped to a given value. * This is equivalent to - * <pre> - * if (map.containsKey(key) && map.get(key).equals(value)) { - * map.remove(key); - * return true; - * } else return false;</pre> + * <pre> {@code + * if (map.containsKey(key) && map.get(key).equals(value)) { + * map.remove(key); + * return true; + * } else + * return false;}</pre> + * * except that the action is performed atomically. * * @param key key with which the specified value is associated @@ -74,20 +77,24 @@ public interface ConcurrentMap<K, V> extends Map<K, V> { * @throws UnsupportedOperationException if the <tt>remove</tt> operation * is not supported by this map * @throws ClassCastException if the key or value is of an inappropriate - * type for this map (optional) + * type for this map + * (<a href="../Collection.html#optional-restrictions">optional</a>) * @throws NullPointerException if the specified key or value is null, - * and this map does not permit null keys or values (optional) + * and this map does not permit null keys or values + * (<a href="../Collection.html#optional-restrictions">optional</a>) */ boolean remove(Object key, Object value); /** * Replaces the entry for a key only if currently mapped to a given value. * This is equivalent to - * <pre> - * if (map.containsKey(key) && map.get(key).equals(oldValue)) { - * map.put(key, newValue); - * return true; - * } else return false;</pre> + * <pre> {@code + * if (map.containsKey(key) && map.get(key).equals(oldValue)) { + * map.put(key, newValue); + * return true; + * } else + * return false;}</pre> + * * except that the action is performed atomically. * * @param key key with which the specified value is associated @@ -108,10 +115,12 @@ public interface ConcurrentMap<K, V> extends Map<K, V> { /** * Replaces the entry for a key only if currently mapped to some value. * This is equivalent to - * <pre> - * if (map.containsKey(key)) { - * return map.put(key, value); - * } else return null;</pre> + * <pre> {@code + * if (map.containsKey(key)) { + * return map.put(key, value); + * } else + * return null;}</pre> + * * except that the action is performed atomically. * * @param key key with which the specified value is associated |