日期:2014-05-20 浏览次数:20988 次
public static boolean action(TreeMap<String,ArrayList<Integer>> map,String key){
ArrayList<Integer> list = map.get(key);
// 如果list是空的,或者对于被给的key没有list 也返回true。
if(list == null || list.size() <= 0){
return true;
}
// 如果对于key,list中的只要有一个<0,就返回false。
for(Integer i : list){
if(i < 0){
return false;
}
}
return true;
}