Lines Matching defs:key

21  * {@code ConcurrentMap} as a key or value
33 * If the specified key is not already associated
37 * if (!map.containsKey(key))
38 * return map.put(key, value);
40 * return map.get(key);}</pre>
44 * @param key key with which the specified value is to be associated
45 * @param value value to be associated with the specified key
46 * @return the previous value associated with the specified key, or
47 * {@code null} if there was no mapping for the key.
49 * previously associated {@code null} with the key,
53 * @throws ClassCastException if the class of the specified key or value
55 * @throws NullPointerException if the specified key or value is null,
57 * @throws IllegalArgumentException if some property of the specified key
60 V putIfAbsent(K key, V value);
63 * Removes the entry for a key only if currently mapped to a given value.
66 * if (map.containsKey(key) && map.get(key).equals(value)) {
67 * map.remove(key);
74 * @param key key with which the specified value is associated
75 * @param value value expected to be associated with the specified key
79 * @throws ClassCastException if the key or value is of an inappropriate
82 * @throws NullPointerException if the specified key or value is null,
86 boolean remove(Object key, Object value);
89 * Replaces the entry for a key only if currently mapped to a given value.
92 * if (map.containsKey(key) && map.get(key).equals(oldValue)) {
93 * map.put(key, newValue);
100 * @param key key with which the specified value is associated
101 * @param oldValue value expected to be associated with the specified key
102 * @param newValue value to be associated with the specified key
106 * @throws ClassCastException if the class of a specified key or value
108 * @throws NullPointerException if a specified key or value is null,
110 * @throws IllegalArgumentException if some property of a specified key
113 boolean replace(K key, V oldValue, V newValue);
116 * Replaces the entry for a key only if currently mapped to some value.
119 * if (map.containsKey(key)) {
120 * return map.put(key, value);
126 * @param key key with which the specified value is associated
127 * @param value value to be associated with the specified key
128 * @return the previous value associated with the specified key, or
129 * {@code null} if there was no mapping for the key.
131 * previously associated {@code null} with the key,
135 * @throws ClassCastException if the class of the specified key or value
137 * @throws NullPointerException if the specified key or value is null,
139 * @throws IllegalArgumentException if some property of the specified key
142 V replace(K key, V value);