AbstractMap.remove

{@inheritDoc}

@implSpec This implementation iterates over <tt>entrySet()</tt> searching for an entry with the specified key. If such an entry is found, its value is obtained with its <tt>getValue</tt> operation, the entry is removed from the collection (and the backing map) with the iterator's <tt>remove</tt> operation, and the saved value is returned. If the iteration terminates without finding such an entry, <tt>null</tt> is returned. Note that this implementation requires linear time in the size of the map; many implementations will override this method.

<p>Note that this implementation throws an <tt>UnsupportedOperationException</tt> if the <tt>entrySet</tt> iterator does not support the <tt>remove</tt> method and this map contains a mapping for the specified key.

@throws UnsupportedOperationException {@inheritDoc} @throws ClassCastException {@inheritDoc} @throws NullPointerException {@inheritDoc}

  1. V remove(K key)
    class AbstractMap(K, V)
    V
    remove
    (
    K key
    )
  2. bool remove(K key, V value)

Meta