public V put(K key, V value)
    {
        // Remove any existing matching key from the data
        V removedObject = remove(key);

        // Insert the data into the map.
        dataMap.put(key, value);

        // If the key is fresh, enqueue it.
        if (removedObject != null)
        {
            keys.offer(key);
        }

        // Return the replaced value if there was one
        return removedObject;
    }
public V put(K key, V value)
    {
        
        V removedObject = remove(key);

        
        dataMap.put(key, value);

        
        if (removedObject != null)
        {
            keys.offer(key);
        }

        
        return removedObject;
    }
public V put ( K key , V value ) { // Remove any existing matching key from the data V removedObject = remove ( key ) ; // Insert the data into the map. dataMap . put ( key , value ) ; // If the key is fresh, enqueue it. if ( removedObject != null ) { keys . offer ( key ) ; } // Return the replaced value if there was one return removedObject ; }
Associates the specified value with the specified key in this map.

@param  key   The key to store against in this map.
@param  value The value to store against the key.

@return The value that was previously stored against the key, or null if there was none.
Associates the specified value with the specified key in this map .