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, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
putin interfaceMap<K extends Serializable,Integer> - Overrides:
putin classAbstractMap<K extends Serializable,Integer>
-
entrySet
- Specified by:
entrySetin interfaceMap<K extends Serializable,Integer> - Specified by:
entrySetin classAbstractMap<K extends Serializable,Integer>
-