All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.tenmg.flink.jobs.utils.MapUtils Maven / Gradle / Ivy

There is a newer version: 1.5.7
Show newest version
package cn.tenmg.flink.jobs.utils;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * 查找表工具类
 * 
 * @author June [email protected]
 * 
 * @since 1.1.2
 */
public abstract class MapUtils {

	/**
	 * 新建哈希查找表并将指定查找表中的元素全部放入后返回
	 * 
	 * @param map
	 *            指定查找表
	 * @return 返回含有指定查找表元素的新的哈希查找表
	 */
	public static  HashMap newHashMap(Map map) {
		HashMap newHashMap = new HashMap();
		newHashMap.putAll(map);
		return newHashMap;
	}

	/**
	 * 使用键集合移除指定查找表中的元素
	 * 
	 * @param map
	 *            指定查找表
	 * @param keys
	 *            键集合
	 */
	public static  void removeAll(Map map, Set keys) {
		for (Iterator it = keys.iterator(); it.hasNext();) {
			map.remove(it.next());
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy