public Object remove ( Object key ) { if ( key == null ) return null ; purge ( ) ; int hash = hashCode ( key ) ; int index = indexFor ( hash ) ; Entry previous = null ; Entry entry = table [ index ] ; while ( entry != null ) { if ( ( hash == entry . hash ) && equals ( key , entry . getKey ( ) ) ) { if ( previous == null ) table [ index ] = entry . next ; else previous . next = entry . next ; this . size -- ; modCount ++ ; return entry . getValue ( ) ; } previous = entry ; entry = entry . next ; } return null ; }
Removes the key and its associated value from this map .