Here you can find the source of remove(Map
Parameter | Description |
---|---|
map | a parameter |
keys | a parameter |
public static <K, V> void remove(Map<K, V> map, Collection<K> keys)
//package com.java2s; //License from project: Apache License import java.util.Collection; import java.util.Map; public class Main { /**//from ww w . j a v a 2s . c o m * <pre> * </pre> * * @param map * @param keys */ public static <K, V> void remove(Map<K, V> map, Collection<K> keys) { if (map == null || map.isEmpty()) { return; } if (keys == null || keys.isEmpty()) { return; } for (K key : keys) { if (key == null) { continue; } map.remove(key); } } /** * <pre> * </pre> * * @param map * @param keys */ public static <K, V> void remove(Map<K, V> map, K[] keys) { if (map == null || map.isEmpty()) { return; } if (keys == null || keys.length == 0) { return; } for (K key : keys) { if (key == null) { continue; } map.remove(key); } } }