public void putDefaults ( Map map ) { Iterator it = map . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) it . next ( ) ; Object key = entry . getKey ( ) ; if ( ! containsKey ( key ) ) { put ( key , entry . getValue ( ) ) ; } } }
Copies the entries of the given map into this one only for keys that aren t contained in this map . Is equivalent to putAll if this map is empty .