/**
 *
 */
package com.foc.util;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @team BBDTEK IT Team
 * @author renmb
 * @version 1.0
 * @time  2017年8月7日
 */
public class MapCounter {

    private final static Map<String, Integer> counter = new HashMap<>();
    
    public static Integer add(String key, Integer count){
        Integer val = counter.get(key);
        if(val == null){
            
            counter.put(key, count);
        } else {
            
            counter.put(key, count+val);
        }
        return counter.get(key);
    }
    public static void list(Integer lower){
        for(String key:counter.keySet()){
            Integer val = counter.get(key);
            if( val >= lower){
                
                System.out.println(key+":"+val);
            }
        }
    }
}
