Key - Value - public abstract class AbstractMultiMap<Key,Value> extends HashMap<Key,Collection<Value>> implements MultiMap<Key,Value>
AbstractMultiMap is a MultiMap which implements most of
the features. It is basically a HashMap, so a given key appears only
once. However, the type of collection used for values is not provided, which
leads to a method to implement in the classes which extend this
AbstractMultiMap.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
AbstractMultiMap() |
AbstractMultiMap(MultiMap<Key,Value> map) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsCouple(Key key,
Value value) |
boolean |
depopulate(Key key,
Collection<Value> values)
Remove some values from a key.
|
boolean |
depopulate(Key key,
Value... values)
|
protected abstract Collection<Value> |
generateInnerCollection(Key key) |
Iterator<Map.Entry<Key,Value>> |
iterator() |
boolean |
populate(Key key,
Collection<Value> values)
Map a key to all the provided values.
|
boolean |
populate(Key key,
Value... values)
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, valuesequals, hashCode, toStringpublic final boolean populate(Key key, Value... values)
MultiMappublic final boolean populate(Key key, Collection<Value> values)
MultiMappublic final boolean depopulate(Key key, Value... values)
MultiMapdepopulate in interface MultiMap<Key,Value>public final boolean depopulate(Key key, Collection<Value> values)
MultiMapdepopulate in interface MultiMap<Key,Value>key - the key to remove values fromvalues - the values to removetrue if some values have been removedprotected abstract Collection<Value> generateInnerCollection(Key key)
public boolean containsCouple(Key key, Value value)
containsCouple in interface MultiMap<Key,Value>key - the key to checkvalue - the value to checktrue if the key is known and the value is actually
mapped to itCopyright © 2014–2015. All rights reserved.