org.jlot.stats.client.StatsHarvester Maven / Gradle / Ivy
package org.jlot.stats.client;
import java.util.Map;
import com.google.common.util.concurrent.AtomicLongMap;
public class StatsHarvester
{
private AtomicLongMap map = AtomicLongMap.create();
public void collect ( String code )
{
try
{
map.getAndIncrement(code);
}
catch (Exception e)
{}
}
public void collect ( String[] codes )
{
try
{
for (int i = 0; i < codes.length; i++)
{
map.getAndIncrement(codes[i]);
}
}
catch (Exception e)
{}
}
public void reset ( )
{
map.clear();
}
public Map getMap ( )
{
return map.asMap();
}
}