Java Map Remove removeMapEntryFromPreferenceStoredMap(String keyOfPreference, String keyInMap)

Here you can find the source of removeMapEntryFromPreferenceStoredMap(String keyOfPreference, String keyInMap)

Description

Removes map entry with key keyInMapfrom the map whose key is keyOfPreference

License

Open Source License

Parameter

Parameter Description
keyOfPreference key of PreferenceStore Map
keyInMap key in the Map

Declaration

public static void removeMapEntryFromPreferenceStoredMap(String keyOfPreference, String keyInMap) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*w  ww. j a v a 2  s . co m*/
 *  Actuate Corporation  - initial API and implementation
 *  Ing. Gerd Stockner (Mayr-Melnhof Karton Gesellschaft m.b.H.) - modifications
 *  Christian Voller (Mayr-Melnhof Karton Gesellschaft m.b.H.) - modifications
 *  CoSMIT GmbH - publishing, maintenance
 *******************************************************************************/

import java.util.HashMap;
import java.util.Map;

public class Main {
    /**
     * Removes map entry with key <tt>keyInMap</tt>from the map whose key
     * is <tt>keyOfPreference</tt>
     * @param keyOfPreference
     *            key of PreferenceStore Map
     * @param keyInMap
     *            key in the Map
     */
    public static void removeMapEntryFromPreferenceStoredMap(String keyOfPreference, String keyInMap) {
        Map map = getPreferenceStoredMap(keyOfPreference);
        if (map.containsKey(keyInMap)) {
            map.remove(keyInMap);
        }
        setPreferenceStoredMap(keyOfPreference, map);
    }

    /**
     * Get Map from PreferenceStore by key
     * @param mapKey the key of the map
     * @return Map 
     */
    public static Map getPreferenceStoredMap(String mapKey) {

        return new HashMap();
    }

    /**
     * Reset the map in PreferenceStored
     * @param keyOfPreference key in PreferenceStore
     * @param map the map to be set 
     */
    public static void setPreferenceStoredMap(String keyOfPreference, Map map) {

    }
}

Related

  1. removeGeneric( List> list)
  2. removeHeader(Map headers, String header)
  3. removeKeyAndConvertToListOfMaps( Object obj, String key)
  4. removeKeys(Collection keys, Map map)
  5. removeKeysWithPrefix(Map map, String prefix)
  6. removeNamespaces(Map properties)
  7. removeNode(Map map, List pathItems)
  8. removeNullEntries(Map map)
  9. removeNullPair(Map map)