ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentMap.java (file contents):
Revision 1.14 by dl, Fri Nov 28 12:37:00 2003 UTC vs.
Revision 1.15 by dl, Wed Dec 3 21:07:44 2003 UTC

# Line 88 | Line 88 | public interface ConcurrentMap<K, V> ext
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines