package com.yonge.toolset.utils.sort;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeSet;

public class SortUtil {

	/**
	 * 按照ASCII码表顺序排序
	 * @param srcMap
	 * @return
	 */
	public static Map<String, Object> sortWithAscII(Map<String, Object> srcMap) {

		LinkedHashMap<String, Object> targetMap = new LinkedHashMap<String, Object>();

		TreeSet<String> sortedKey = new TreeSet<String>(srcMap.keySet());
		for (String key : sortedKey) {
			targetMap.put(key, srcMap.get(key));
		}
		return targetMap;
	}
}
