public V get ( K key , V defaultValue ) { // Check if we only know an equal entry V sharedValue = get ( key ) ; if ( sharedValue == null ) { // If no entry can be found, store and return the passed one sharedValue = defaultValue ; // Make sure to remember the entry put ( key , defaultValue ) ; } // Return the shared entry return sharedValue ; }
Get the value associated to the passed key . If no value can be found stored and return the passed default value .