ch.javasoft.util.map
Class AbstractMutableMultiValueMap<K,V>

java.lang.Object
  extended by ch.javasoft.util.map.AbstractMultiValueMap<K,V>
      extended by ch.javasoft.util.map.AbstractMutableMultiValueMap<K,V>
All Implemented Interfaces:
MultiValueMap<K,V>
Direct Known Subclasses:
DefaultIntIntMultiValueMap, DefaultMultiValueMap

public abstract class AbstractMutableMultiValueMap<K,V>
extends AbstractMultiValueMap<K,V>

Abstract implementation for MultiValueMap for most common methods for subclasses


Constructor Summary
AbstractMutableMultiValueMap()
          Constructor for an empty mapping
AbstractMutableMultiValueMap(MultiValueMap<? extends K,? extends V> copy)
          Constructor for a mapping based on an existing mapping to copy
 
Method Summary
 boolean addAll(K key, Collection<? extends V> values)
          Adds the given values to the key collection
 boolean addAll(K key, V... values)
          Adds the given values to the key collection
 boolean addAll(Map<? extends K,? extends V> map)
          Adds the key/value map entries of the given map to this key collection
 boolean addAll(MultiValueMap<? extends K,? extends V> mapping)
          Adds the key/value-collection entries of the given mapping to this key collection
 boolean addAllNested(Map<? extends K,? extends Collection<? extends V>> map)
          Adds the key/value-collection entries of the given map to this key collection
 
Methods inherited from class ch.javasoft.util.map.AbstractMultiValueMap
add, asCollectionMap, asSingleValueMap, clear, contains, equals, getFirst, hashCode, invert, isEmpty, keySize, remove, remove, toString, values, valueSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.javasoft.util.map.MultiValueMap
contains, count, get, keySet
 

Constructor Detail

AbstractMutableMultiValueMap

public AbstractMutableMultiValueMap()
Constructor for an empty mapping


AbstractMutableMultiValueMap

public AbstractMutableMultiValueMap(MultiValueMap<? extends K,? extends V> copy)
Constructor for a mapping based on an existing mapping to copy

Method Detail

addAll

public boolean addAll(K key,
                      V... values)
Adds the given values to the key collection

Specified by:
addAll in interface MultiValueMap<K,V>
Overrides:
addAll in class AbstractMultiValueMap<K,V>
Parameters:
key - the key which identifies the value collection
values - the values to add
Returns:
true if this map has changed as a consequence of this operation
Throws:
UnsupportedOperationException - if this is an immutable map

addAll

public boolean addAll(K key,
                      Collection<? extends V> values)
Adds the given values to the key collection

Specified by:
addAll in interface MultiValueMap<K,V>
Overrides:
addAll in class AbstractMultiValueMap<K,V>
Parameters:
key - the key which identifies the value collection
values - the values to add
Returns:
true if this map has changed as a consequence of this operation
Throws:
UnsupportedOperationException - if this is an immutable map

addAll

public boolean addAll(Map<? extends K,? extends V> map)
Adds the key/value map entries of the given map to this key collection

Specified by:
addAll in interface MultiValueMap<K,V>
Overrides:
addAll in class AbstractMultiValueMap<K,V>
Parameters:
map - the map containing key/value-collection entries to add
Returns:
true if this map has changed as a consequence of this operation
Throws:
UnsupportedOperationException - if this is an immutable map

addAllNested

public boolean addAllNested(Map<? extends K,? extends Collection<? extends V>> map)
Adds the key/value-collection entries of the given map to this key collection

Specified by:
addAllNested in interface MultiValueMap<K,V>
Overrides:
addAllNested in class AbstractMultiValueMap<K,V>
Parameters:
map - the map containing key/value-collection entries to add
Returns:
true if this map has changed as a consequence of this operation
Throws:
UnsupportedOperationException - if this is an immutable map

addAll

public boolean addAll(MultiValueMap<? extends K,? extends V> mapping)
Adds the key/value-collection entries of the given mapping to this key collection

Specified by:
addAll in interface MultiValueMap<K,V>
Overrides:
addAll in class AbstractMultiValueMap<K,V>
Parameters:
mapping - the mapping containing key/value-collection entries to add
Returns:
true if this map has changed as a consequence of this operation
Throws:
UnsupportedOperationException - if this is an immutable map