Package com.gengoai.collection.multimap
Class BaseMultimap<K,V,C extends Collection<V>>
- java.lang.Object
-
- com.gengoai.collection.multimap.BaseMultimap<K,V,C>
-
- Type Parameters:
K
- the key type parameterV
- the value type parameterC
- the type parameter
- All Implemented Interfaces:
Multimap<K,V>
,Serializable
- Direct Known Subclasses:
ListMultimap
,SetMultimap
public abstract class BaseMultimap<K,V,C extends Collection<V>> extends Object implements Multimap<K,V>, Serializable
List backed multimaps- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseMultimap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<K,Collection<V>>
asMap()
A map representation of the multimap where the values are represented in a Collection.boolean
equals(Object o)
int
hashCode()
C
removeAll(Object key)
Removes all values for the given key.void
replace(K key, Iterable<? extends V> values)
Replaces the values for a given key with the given new valuesString
toString()
-
-
-
Field Detail
-
map
protected final Map<K,C extends Collection<V>> map
The Map.
-
-
Method Detail
-
removeAll
public C removeAll(Object key)
Description copied from interface:Multimap
Removes all values for the given key.
-
replace
public void replace(K key, Iterable<? extends V> values)
Description copied from interface:Multimap
Replaces the values for a given key with the given new values
-
asMap
public Map<K,Collection<V>> asMap()
Description copied from interface:Multimap
A map representation of the multimap where the values are represented in a Collection.
-
-