Class AbstractListValuedMap<K,V>
- java.lang.Object
 - 
- org.apache.commons.collections4.multimap.AbstractMultiValuedMap<K,V>
 - 
- org.apache.commons.collections4.multimap.AbstractListValuedMap<K,V>
 
 
 
- 
- Type Parameters:
 K- the type of the keys in this mapV- the type of the values in this map
- All Implemented Interfaces:
 ListValuedMap<K,V>,MultiValuedMap<K,V>
- Direct Known Subclasses:
 ArrayListValuedHashMap
public abstract class AbstractListValuedMap<K,V> extends AbstractMultiValuedMap<K,V> implements ListValuedMap<K,V>
Abstract implementation of theListValuedMapinterface to simplify the creation of subclass implementations.Subclasses specify a Map implementation to use as the internal storage and the List implementation to use as values.
- Since:
 - 4.1
 
 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<V>get(K key)Gets the list of values associated with the specified key.java.util.List<V>remove(java.lang.Object key)Removes all values associated with the specified key.- 
Methods inherited from class org.apache.commons.collections4.multimap.AbstractMultiValuedMap
asMap, clear, containsKey, containsMapping, containsValue, entries, equals, hashCode, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, size, toString, values 
- 
Methods inherited from interface org.apache.commons.collections4.MultiValuedMap
asMap, clear, containsKey, containsMapping, containsValue, entries, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, size, values 
 - 
 
 - 
 
- 
- 
Method Detail
- 
get
public java.util.List<V> get(K key)
Gets the list of values associated with the specified key. This would return an empty list in case the mapping is not present- Specified by:
 getin interfaceListValuedMap<K,V>- Specified by:
 getin interfaceMultiValuedMap<K,V>- Overrides:
 getin classAbstractMultiValuedMap<K,V>- Parameters:
 key- the key to retrieve- Returns:
 - the 
Listof values, will return an emptyListfor no mapping 
 
- 
remove
public java.util.List<V> remove(java.lang.Object key)
Removes all values associated with the specified key.A subsequent
get(Object)would return an empty list.- Specified by:
 removein interfaceListValuedMap<K,V>- Specified by:
 removein interfaceMultiValuedMap<K,V>- Overrides:
 removein classAbstractMultiValuedMap<K,V>- Parameters:
 key- the key to remove values from- Returns:
 - the 
Listof values removed, will return an empty, unmodifiable list for no mapping found. 
 
 - 
 
 -