Class ListingHash<K,V>
java.lang.Object
com.kingsrook.qqq.backend.core.utils.ListingHash<K,V>
- All Implemented Interfaces:
Serializable,Map<K,List<V>>
Hash that provides "listing" capability -- keys map to lists of values that
are automatically/easily added to
- See Also:
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorListingHash(Map<K, List<V>> 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 TypeMethodDescriptionAdd a value to the entry/list for this keyvoidaddAll(ListingHash<K, V> that) Add all object from another ListingHash ('that') to this one.voidAdd all elements of the collection of v's to this listing hash, using keys generated by passing each v to the supplied keyFunction (which return's K's)addAll(K key, Collection<V> values) Add multiple values to the entry/list for this keyvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleaninthashCode()booleanisEmpty()keySet()voidintsize()Collection<List<V>> values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
ListingHash
public ListingHash()Default constructor -
ListingHash
-
-
Method Details
-
add
-
addAll
Add all elements of the collection of v's to this listing hash, using keys generated by passing each v to the supplied keyFunction (which return's K's) -
addAll
Add multiple values to the entry/list for this key -
addAll
Add all object from another ListingHash ('that') to this one. Note, does it at the level of the whole key=list (e.g., if a key was already in this, it'll be replaced with the list from 'that'. -
clear
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
entrySet
-
equals
-
get
-
hashCode
-
isEmpty
-
keySet
-
put
-
putAll
-
remove
-
size
-
values
-