Lines Matching defs:key

30  * each key can map to at most one value.
37 * or set of key-value mappings. The <i>order</i> of a map is defined as
46 * object is a key in the map. A special case of this prohibition is that it
47 * is not permissible for a map to contain itself as a key. While it is
55 * which creates a new map with the same key-value mappings as its argument.
73 * to insert an ineligible key or value throws an unchecked exception,
75 * Attempting to query the presence of an ineligible key or value may throw an
78 * attempting an operation on an ineligible key or value whose completion
91 * containsKey(Object key)} method says: "returns <tt>true</tt> if and
92 * only if this map contains a mapping for a key <tt>k</tt> such that
93 * <tt>(key==null ? k==null : key.equals(k))</tt>." This specification should
95 * with a non-null argument <tt>key</tt> will cause <tt>key.equals(k)</tt> to
96 * be invoked for any key <tt>k</tt>. Implementations are free to
121 * Returns the number of key-value mappings in this map. If the
125 * @return the number of key-value mappings in this map
130 * Returns <tt>true</tt> if this map contains no key-value mappings.
132 * @return <tt>true</tt> if this map contains no key-value mappings
138 * key. More formally, returns <tt>true</tt> if and only if
139 * this map contains a mapping for a key <tt>k</tt> such that
140 * <tt>(key==null ? k==null : key.equals(k))</tt>. (There can be
143 * @param key key whose presence in this map is to be tested
145 * key
146 * @throws ClassCastException if the key is of an inappropriate type for
149 * @throws NullPointerException if the specified key is null and this map
153 boolean containsKey(Object key);
176 * Returns the value to which the specified key is mapped,
177 * or {@code null} if this map contains no mapping for the key.
179 * <p>More formally, if this map contains a mapping from a key
180 * {@code k} to a value {@code v} such that {@code (key==null ? k==null :
181 * key.equals(k))}, then this method returns {@code v}; otherwise
186 * contains no mapping for the key; it's also possible that the map
187 * explicitly maps the key to {@code null}. The {@link #containsKey
190 * @param key the key whose associated value is to be returned
191 * @return the value to which the specified key is mapped, or
192 * {@code null} if this map contains no mapping for the key
193 * @throws ClassCastException if the key is of an inappropriate type for
196 * @throws NullPointerException if the specified key is null and this map
200 V get(Object key);
205 * Associates the specified value with the specified key in this map
207 * the key, the old value is replaced by the specified value. (A map
208 * <tt>m</tt> is said to contain a mapping for a key <tt>k</tt> if and only
212 * @param key key with which the specified value is to be associated
213 * @param value value to be associated with the specified key
214 * @return the previous value associated with <tt>key</tt>, or
215 * <tt>null</tt> if there was no mapping for <tt>key</tt>.
217 * previously associated <tt>null</tt> with <tt>key</tt>,
221 * @throws ClassCastException if the class of the specified key or value
223 * @throws NullPointerException if the specified key or value is null
225 * @throws IllegalArgumentException if some property of the specified key
228 V put(K key, V value);
231 * Removes the mapping for a key from this map if it is present
233 * from key <tt>k</tt> to value <tt>v</tt> such that
234 * <code>(key==null ? k==null : key.equals(k))</code>, that mapping
237 * <p>Returns the value to which this map previously associated the key,
238 * or <tt>null</tt> if the map contained no mapping for the key.
242 * contained no mapping for the key; it's also possible that the map
243 * explicitly mapped the key to <tt>null</tt>.
245 * <p>The map will not contain a mapping for the specified key once the
248 * @param key key whose mapping is to be removed from the map
249 * @return the previous value associated with <tt>key</tt>, or
250 * <tt>null</tt> if there was no mapping for <tt>key</tt>.
253 * @throws ClassCastException if the key is of an inappropriate type for
256 * @throws NullPointerException if the specified key is null and this
260 V remove(Object key);
269 * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the
276 * @throws ClassCastException if the class of a key or value in the
281 * @throws IllegalArgumentException if some property of a key or value in
351 * A map entry (key-value pair). The <tt>Map.entrySet</tt> method returns
365 * Returns the key corresponding to this entry.
367 * @return the key corresponding to this entry