List of utility methods to do Map Remove
Object | removeFromMapValues(final Map map, final Object value) Removes the specified reader/writer from the values of the specified reader/writer map. synchronized (map) { final Collection entries = map.entrySet(); for (final Iterator iter = entries.iterator(); iter.hasNext();) { final Map.Entry entry = (Entry) iter.next(); if (entry.getValue().equals(value)) { final Object key = entry.getKey(); iter.remove(); return key; ... |
List | removeGeneric(List remove Generic if (list == null) { return null; List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); for (int i = 0; i < list.size(); i++) { Map<String, T> map = list.get(i); Map<String, Object> newMap = new HashMap<String, Object>(); newMap.putAll(map); ... |
void | removeHeader(Map remove Header if (header != null && headers.containsKey(header)) {
headers.remove(header);
|
List | removeKeyAndConvertToListOfMaps(Object obj, String key) removeKeyAndConvertToListOfMaps - This method is written to meet the requirement for BML Indigo. List<Map<Object, Object>> listofMaps = null; if (obj instanceof Map) { listofMaps = new ArrayList<Map<Object, Object>>(); Map<Object, Object> map = (Map<Object, Object>) obj; if (map.containsKey(key)) map.remove(key); for (Entry<Object, Object> mapEntry : map.entrySet()) { Map<Object, Object> listmap = new HashMap<Object, Object>(); ... |
void | removeKeys(Collection keys, Map map) remove Keys for (Iterator i = keys.iterator(); i.hasNext();) {
Object key = (Object) i.next();
map.remove(key);
|
void | removeKeysWithPrefix(Map remove Keys With Prefix Iterator<Map.Entry<String, Object>> iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<String, Object> e = iter.next(); if (e.getKey().startsWith(prefix)) { iter.remove(); |
void | removeMapEntryFromPreferenceStoredMap(String keyOfPreference, String keyInMap) Removes map entry with key keyInMapfrom the map whose key is keyOfPreference Map map = getPreferenceStoredMap(keyOfPreference);
if (map.containsKey(keyInMap)) {
map.remove(keyInMap);
setPreferenceStoredMap(keyOfPreference, map);
|
Map | removeNamespaces(Map properties) remove Namespaces HashMap props = new HashMap(properties.size()); Map.Entry entry; for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) { entry = (Map.Entry) iter.next(); props.put(removeNamespacePrefix((String) entry.getKey()), entry.getValue()); return props; |
void | removeNode(Map remove Node Map<String, Object> m = map; Map<String, Object> subm = m; String name = null; for (String pathItem : pathItems) { name = pathItem; m = subm; subm = (Map<String, Object>) m.get(name); if (subm == null) ... |
Map | removeNullEntries(Map map) Returns a new map with all entries of the input map except those which have a value of null.
HashMap<A, B> result = new HashMap<A, B>(); for (Map.Entry<A, B> entry : map.entrySet()) { if (entry.getValue() != null) { result.put(entry.getKey(), entry.getValue()); return result; |