Java AtomicLong addstat(Map stat, String key)

Here you can find the source of addstat(Map stat, String key)

Description

addstat

License

Apache License

Declaration

public static void addstat(Map<String, AtomicLong> stat, String key) 

Method Source Code

//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();
    }
}

Related

  1. add(AtomicLong requested, long n)
  2. add(AtomicLongFieldUpdater updater, T instance, long n)
  3. addAndGet(AtomicLong current, long toAdd)
  4. average(Stream stream)
  5. compareAndSetIfGreater(final AtomicLong dest, final long tryValue)
  6. createAtomicId()
  7. createId(final Long baseId)