Here you can find the source of getNewLogFactor(String factorName)
private static int getNewLogFactor(String factorName)
//package com.java2s; /**/*from w w w. java 2 s . c om*/ * Project: avatar-cache * * File Created at 2011-9-13 * $Id$ * * Copyright 2010 dianping.com. * All rights reserved. * * This software is the confidential and proprietary information of * Dianping Company. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with dianping.com. */ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; public class Main { private static ConcurrentMap<String, Integer> logFactorMap = new ConcurrentHashMap<String, Integer>(); private static int getNewLogFactor(String factorName) { Integer newFactor = null; if (logFactorMap.containsKey(factorName)) { Integer oldFactor = logFactorMap.get(factorName); newFactor = oldFactor + 1; logFactorMap.put(factorName, newFactor); } else { logFactorMap.put(factorName, 0); newFactor = 0; } return newFactor; } }