标签:io ar sp java on cti bs size nbsp
/**
* 求Map<K,V>中Value(值)的最小值
*
* @param map
* @return
*/
public static Object getMinValue(Map<Integer, Integer> map) {
if (map == null)
return null;
Collection<Integer> c = map.values();
Object[] obj = c.toArray();
Arrays.sort(obj);
return obj[0];
}
/**
* 求Map<K,V>中Value(值)的最大值
*
* @param map
* @return
*/
public static Object getMaxValue(Map<Integer, Integer> map) {
if (map == null)
return null;
int length =map.size();
Collection<Integer> c = map.values();
Object[] obj = c.toArray();
Arrays.sort(obj);
return obj[length-1];
}
标签:io ar sp java on cti bs size nbsp
原文地址:http://www.cnblogs.com/xiaoblog/p/4118022.html