Here you can find the source of addstat(Map
public static void addstat(Map<String, AtomicLong> stat, String key)
//package com.java2s; //License from project: Apache License import java.util.Map; import java.util.concurrent.atomic.AtomicLong; public class Main { public static void addstat(Map<String, AtomicLong> stat, String key) { AtomicLong count = stat.get(key); if (null == count) { count = new AtomicLong(); stat.put(key, count);/*from www . j a va 2 s . c om*/ } count.incrementAndGet(); } }