Class CountingHash<K extends Serializable>
java.lang.Object
java.util.AbstractMap<K,Integer>
com.kingsrook.qqq.backend.core.utils.CountingHash<K>
- All Implemented Interfaces:
Serializable
,Map<K,
Integer>
public class CountingHash<K extends Serializable>
extends AbstractMap<K,Integer>
implements Serializable
Hash that provides "counting" capability -- keys map to Integers that
are automatically/easily summed to
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCountingHash
(Map<K, Integer> sourceMap) Constructor where you can supply a source map (e.g., if you want a specific Map type (like LinkedHashMap), or with pre-values. -
Method Summary
Modifier and TypeMethodDescriptionIncrement the value for the specified key by 1.Increment the value for the specified key by the supplied addendentrySet()
increment the value for the specified keySet the value for the specified key by the supplied valueMethods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
CountingHash
public CountingHash()Default constructor -
CountingHash
-
-
Method Details
-
add
-
add
-
put
-
put
Set the value for the specified key by the supplied value- Specified by:
put
in interfaceMap<K extends Serializable,
Integer> - Overrides:
put
in classAbstractMap<K extends Serializable,
Integer>
-
entrySet
- Specified by:
entrySet
in interfaceMap<K extends Serializable,
Integer> - Specified by:
entrySet
in classAbstractMap<K extends Serializable,
Integer>
-