Package com.gengoai.collection.counter
Class ConcurrentHashMapMultiCounter<K,V>
- java.lang.Object
-
- com.gengoai.collection.counter.BaseMultiCounter<K,V>
-
- com.gengoai.collection.counter.ConcurrentHashMapMultiCounter<K,V>
-
- Type Parameters:
K
- the first key typeV
- the second type
- All Implemented Interfaces:
MultiCounter<K,V>
,Serializable
public class ConcurrentHashMapMultiCounter<K,V> extends BaseMultiCounter<K,V>
Implementation of a MultiCounter using a ConcurrentHashMaps withConcurrentHashMapCounter
as the child counters..- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConcurrentHashMapMultiCounter()
Instantiates a new ConcurrentHashMapMultiCounter.ConcurrentHashMapMultiCounter(@NonNull Collection<Tuple3<K,V,Double>> items)
Instantiates a new ConcurrentHashMapMultiCounter initializing it with the given values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Counter<V>
createCounter()
Creates a new counter.protected MultiCounter<K,V>
newInstance()
New instance.-
Methods inherited from class com.gengoai.collection.counter.BaseMultiCounter
adjustValues, adjustValuesSelf, clear, contains, contains, entries, filterByFirstKey, filterBySecondKey, filterByValue, firstKeys, get, isEmpty, itemsByCount, keyPairs, merge, remove, remove, set, set, size, toString, values
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.gengoai.collection.counter.MultiCounter
average, decrement, decrement, decrementAll, decrementAll, divideByKeySum, divideBySum, get, increment, increment, incrementAll, incrementAll, magnitude, maximumCount, minimumCount, removeAll, secondKeys, setIfAbsent, standardDeviation, sum, toJson, transpose, writeCsv
-
-
-
-
Constructor Detail
-
ConcurrentHashMapMultiCounter
public ConcurrentHashMapMultiCounter(@NonNull @NonNull Collection<Tuple3<K,V,Double>> items)
Instantiates a new ConcurrentHashMapMultiCounter initializing it with the given values.- Parameters:
items
- the items
-
ConcurrentHashMapMultiCounter
public ConcurrentHashMapMultiCounter()
Instantiates a new ConcurrentHashMapMultiCounter.
-
-
Method Detail
-
createCounter
protected Counter<V> createCounter()
Description copied from class:BaseMultiCounter
Creates a new counter.- Specified by:
createCounter
in classBaseMultiCounter<K,V>
- Returns:
- the counter
-
newInstance
protected MultiCounter<K,V> newInstance()
Description copied from class:BaseMultiCounter
New instance.- Specified by:
newInstance
in classBaseMultiCounter<K,V>
- Returns:
- the multi counter
-
-