Class AbstractMultimap<K, V, C extends Collection<V>>
java.lang.Object
org.greenrobot.essentials.collections.AbstractMultimap<K,V,C>
- All Implemented Interfaces:
Map<K,C>
- Direct Known Subclasses:
Multimap, MultimapSet
public abstract class AbstractMultimap<K, V, C extends Collection<V>>
extends Object
implements Map<K,C>
Combines a Map with List values to provide simple way to store multiple values for a key (multimap).
Threading note: All methods are synchronized
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsElement(K key, V value) booleancontainsElement(V value) booleancontainsKey(Object key) booleancontainsValue(Object value) intintcountElements(K key) protected abstract CentrySet()booleaninthashCode()booleanisEmpty()keySet()voidintputElement(K key, V value) booleanputElements(K key, Collection<V> values) booleanremoveElement(K key, V value) intsize()values()Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
map
-
-
Constructor Details
-
AbstractMultimap
-
-
Method Details
-
createNewCollection
-
putAll
-
size
-
isEmpty
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
remove
-
clear
-
keySet
-
values
-
equals
-
hashCode
-
putElement
-
put
-
entrySet
-
putElements
- Returns:
- true if the collection was changed.
-
removeElement
-
countElements
-
countElements
public int countElements() -
containsElement
-
containsElement
-
valuesElements
-