Class AbstractSetValuedMap<K,V> 
java.lang.Object
org.apache.commons.collections4.multimap.AbstractMultiValuedMap<K,V>
 
org.apache.commons.collections4.multimap.AbstractSetValuedMap<K,V> 
- Type Parameters:
- K- the type of the keys in this map
- V- the type of the values in this map
- All Implemented Interfaces:
- MultiValuedMap<K,,- V> - SetValuedMap<K,- V> 
- Direct Known Subclasses:
- HashSetValuedHashMap,- LinkedHashSetValuedLinkedHashMap
public abstract class AbstractSetValuedMap<K,V> 
extends AbstractMultiValuedMap<K,V>
implements SetValuedMap<K,V>  
Abstract implementation of the 
SetValuedMap interface to simplify the
 creation of subclass implementations.
 Subclasses specify a Map implementation to use as the internal storage and the Set implementation to use as values.
- Since:
- 4.1
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructor needed for subclass serialization.protectedAbstractSetValuedMap(Map<K, ? extends Set<V>> map) A constructor that wraps, not copies
- 
Method SummaryModifier and TypeMethodDescriptionCreates a new value collection using the provided factory.Gets the set of values associated with the specified key.getMap()Gets the map being wrapped.Removes all values associated with the specified key.Methods inherited from class org.apache.commons.collections4.multimap.AbstractMultiValuedMapasMap, clear, containsKey, containsMapping, containsValue, doReadObject, doWriteObject, entries, equals, hashCode, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, setMap, size, toString, valuesMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.collections4.MultiValuedMapasMap, clear, containsKey, containsMapping, containsValue, entries, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, size, values
- 
Constructor Details- 
AbstractSetValuedMapprotected AbstractSetValuedMap()Constructor needed for subclass serialization.
- 
AbstractSetValuedMapA constructor that wraps, not copies- Parameters:
- map- the map to wrap, must not be null
- Throws:
- NullPointerException- if the map is null
 
 
- 
- 
Method Details- 
createCollectionCreates a new value collection using the provided factory.- Specified by:
- createCollectionin class- AbstractMultiValuedMap<K,- V> 
- Returns:
- a new set
 
- 
getGets the set of values associated with the specified key. This would return an empty set in case the mapping is not present- Specified by:
- getin interface- MultiValuedMap<K,- V> 
- Specified by:
- getin interface- SetValuedMap<K,- V> 
- Overrides:
- getin class- AbstractMultiValuedMap<K,- V> 
- Parameters:
- key- the key to retrieve
- Returns:
- the Setof values, will return an emptySetfor no mapping
 
- 
getMapDescription copied from class:AbstractMultiValuedMapGets the map being wrapped.- Overrides:
- getMapin class- AbstractMultiValuedMap<K,- V> 
- Returns:
- the wrapped map
 
- 
removeRemoves all values associated with the specified key.A subsequent get(Object)would return an empty set.- Specified by:
- removein interface- MultiValuedMap<K,- V> 
- Specified by:
- removein interface- SetValuedMap<K,- V> 
- Overrides:
- removein class- AbstractMultiValuedMap<K,- V> 
- Parameters:
- key- the key to remove values from
- Returns:
- the Setof values removed, will return an empty, unmodifiable set for no mapping found.
 
 
-