T - The type of the key for the mapped counter, often this
will be String, but any type that can be used as key for
a HashMap will work here.public class ConcurrentMappedCounter<T> extends java.lang.Object implements MappedCounter<T>
MappedCounter,
currently internally delegates to a MappedCounterImpl| Constructor and Description |
|---|
ConcurrentMappedCounter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInt(T k,
int v) |
void |
clear() |
void |
count(java.util.Collection<T> items) |
java.util.Set<java.util.Map.Entry<T,java.lang.Integer>> |
entries() |
int |
get(T k) |
java.util.Set<T> |
keys() |
int |
remove(T key) |
java.util.Map<T,java.lang.Integer> |
sortedMap() |
int |
sum() |
java.lang.String |
toString() |
public void addInt(T k, int v)
addInt in interface MappedCounter<T>public void count(java.util.Collection<T> items)
count in interface MappedCounter<T>public int get(T k)
get in interface MappedCounter<T>public int remove(T key)
remove in interface MappedCounter<T>public java.util.Set<T> keys()
keys in interface MappedCounter<T>public java.util.Set<java.util.Map.Entry<T,java.lang.Integer>> entries()
entries in interface MappedCounter<T>public void clear()
clear in interface MappedCounter<T>public java.util.Map<T,java.lang.Integer> sortedMap()
sortedMap in interface MappedCounter<T>public int sum()
sum in interface MappedCounter<T>public java.lang.String toString()
toString in interface MappedCounter<T>toString in class java.lang.Object