src/share/classes/java/util/Map.java
Print this page
rev 3977 : 6546713: link the word (optional) in exception specifications to the text which provides explanation and context.
*** 142,154 ****
*
* @param key key whose presence in this map is to be tested
* @return <tt>true</tt> if this map contains a mapping for the specified
* key
* @throws ClassCastException if the key is of an inappropriate type for
! * this map (optional)
* @throws NullPointerException if the specified key is null and this map
! * does not permit null keys (optional)
*/
boolean containsKey(Object key);
/**
* Returns <tt>true</tt> if this map maps one or more keys to the
--- 142,156 ----
*
* @param key key whose presence in this map is to be tested
* @return <tt>true</tt> if this map contains a mapping for the specified
* key
* @throws ClassCastException if the key is of an inappropriate type for
! * this map
! * (<a href="Collection.html#optional-restrictions">optional</a>)
* @throws NullPointerException if the specified key is null and this map
! * does not permit null keys
! * (<a href="Collection.html#optional-restrictions">optional</a>)
*/
boolean containsKey(Object key);
/**
* Returns <tt>true</tt> if this map maps one or more keys to the
*** 160,172 ****
*
* @param value value whose presence in this map is to be tested
* @return <tt>true</tt> if this map maps one or more keys to the
* specified value
* @throws ClassCastException if the value is of an inappropriate type for
! * this map (optional)
* @throws NullPointerException if the specified value is null and this
! * map does not permit null values (optional)
*/
boolean containsValue(Object value);
/**
* Returns the value to which the specified key is mapped,
--- 162,176 ----
*
* @param value value whose presence in this map is to be tested
* @return <tt>true</tt> if this map maps one or more keys to the
* specified value
* @throws ClassCastException if the value is of an inappropriate type for
! * this map
! * (<a href="Collection.html#optional-restrictions">optional</a>)
* @throws NullPointerException if the specified value is null and this
! * map does not permit null values
! * (<a href="Collection.html#optional-restrictions">optional</a>)
*/
boolean containsValue(Object value);
/**
* Returns the value to which the specified key is mapped,
*** 185,197 ****
*
* @param key the key whose associated value is to be returned
* @return the value to which the specified key is mapped, or
* {@code null} if this map contains no mapping for the key
* @throws ClassCastException if the key is of an inappropriate type for
! * this map (optional)
* @throws NullPointerException if the specified key is null and this map
! * does not permit null keys (optional)
*/
V get(Object key);
// Modification Operations
--- 189,203 ----
*
* @param key the key whose associated value is to be returned
* @return the value to which the specified key is mapped, or
* {@code null} if this map contains no mapping for the key
* @throws ClassCastException if the key is of an inappropriate type for
! * this map
! * (<a href="Collection.html#optional-restrictions">optional</a>)
* @throws NullPointerException if the specified key is null and this map
! * does not permit null keys
! * (<a href="Collection.html#optional-restrictions">optional</a>)
*/
V get(Object key);
// Modification Operations
*** 243,255 ****
* @return the previous value associated with <tt>key</tt>, or
* <tt>null</tt> if there was no mapping for <tt>key</tt>.
* @throws UnsupportedOperationException if the <tt>remove</tt> operation
* is not supported by this map
* @throws ClassCastException if the key is of an inappropriate type for
! * this map (optional)
* @throws NullPointerException if the specified key is null and this
! * map does not permit null keys (optional)
*/
V remove(Object key);
// Bulk Operations
--- 249,263 ----
* @return the previous value associated with <tt>key</tt>, or
* <tt>null</tt> if there was no mapping for <tt>key</tt>.
* @throws UnsupportedOperationException if the <tt>remove</tt> operation
* is not supported by this map
* @throws ClassCastException if the key is of an inappropriate type for
! * this map
! * (<a href="Collection.html#optional-restrictions">optional</a>)
* @throws NullPointerException if the specified key is null and this
! * map does not permit null keys
! * (<a href="Collection.html#optional-restrictions">optional</a>)
*/
V remove(Object key);
// Bulk Operations