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 TypeMethodDescriptionvoid
clear()
boolean
containsElement
(K key, V value) boolean
containsElement
(V value) boolean
containsKey
(Object key) boolean
containsValue
(Object value) int
int
countElements
(K key) protected abstract C
entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
void
int
putElement
(K key, V value) boolean
putElements
(K key, Collection<V> values) boolean
removeElement
(K key, V value) int
size()
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
-
map
-
-
Constructor Details
-
AbstractMultimap
-
-
Method Details
-
createNewCollection
-
putAll
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
remove
-
clear
public void clear() -
keySet
-
values
-
equals
-
hashCode
public int hashCode() -
putElement
- Returns:
- number of elements stored for given key after storing the given value.
-
put
-
entrySet
-
putElements
- Returns:
- true if the collection was changed.
-
removeElement
- Returns:
- true if the given element was removed.
-
countElements
-
countElements
public int countElements() -
containsElement
-
containsElement
-
valuesElements
-