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 keyvoid
addAll
(ListingHash<K, V> that) Add all object from another ListingHash ('that') to this one.void
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
(K key, Collection<V> values) Add multiple values to the entry/list for this keyvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
void
int
size()
Collection
<List<V>> values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
entrySet
-
equals
-
get
-
hashCode
-
isEmpty
-
keySet
-
put
-
putAll
-
remove
-
size
-
values
-