public interface MultiMap<K,V>
Map
Modifier and Type | Method and Description |
---|---|
Map<K,Set<V>> |
asMap()
Returns a
Map -based view of this MultiMap |
void |
clear()
Removes all of the mappings from this multi-map.
|
boolean |
containsKey(Object key)
Returns
true if this multi-map contains a mapping for the
specified key. |
boolean |
containsMapping(Object key,
Object value)
Returns
true if this multi-map contains a mapping from specified
key to the specified value. |
boolean |
containsValue(Object key)
Returns
true if this multi-map contains from any key to the
specified value. |
Set<Map.Entry<K,V>> |
entrySet()
Returns a
Set view of all the key-value mappings contained in
this multi-map. |
Set<V> |
get(Object key)
Returns the set of values mapped to this key or
null of the key
is not mapped to any values |
boolean |
isEmpty()
Returns
true if this multi-map contains no mappings. |
Set<K> |
keySet()
Returns a
Set view of the mappings contained in this multi-map. |
boolean |
put(K key,
V value)
Adds the specified value to the set of values associated with the
specified key in this map.
|
void |
putAll(Map<? extends K,? extends V> m)
Copies all of the mappings from the specified map to this mutli-map
|
void |
putAll(MultiMap<? extends K,? extends V> m)
Copies all of the mappings from the specified mulit-map to this mutli-map
|
boolean |
putMany(K key,
Collection<V> values)
Adds all of the specified values to the set of values associated with the
specified key in this map.
|
int |
range()
Returns the number of values maped to keys.
|
Set<V> |
remove(K key)
Removes the mapping for a key from this multi-map if it is present,
returning any mapped values to that key
|
boolean |
remove(Object key,
Object value)
Removes the specified mapping for a key if it is present.
|
int |
size()
Returns the number of keys that are mapped to one or more values in this
multi-map.
|
Collection<V> |
values()
Returns a
Collection view of the values contained in this map. |
Collection<Set<V>> |
valueSets()
Returns a
Collection view of the sets of values mapped to each
key in this map. |
void clear()
boolean containsKey(Object key)
true
if this multi-map contains a mapping for the
specified key.boolean containsMapping(Object key, Object value)
true
if this multi-map contains a mapping from specified
key to the specified value.boolean containsValue(Object key)
true
if this multi-map contains from any key to the
specified value.Set<Map.Entry<K,V>> entrySet()
Set
view of all the key-value mappings contained in
this multi-map.Set<V> get(Object key)
null
of the key
is not mapped to any valuesboolean isEmpty()
true
if this multi-map contains no mappings.boolean put(K key, V value)
key
- key with which the specified value is to be associatedvalue
- a value to be associated with the specified keytrue
if the provided value was not already in the set of
value mapped to the specified keyvoid putAll(Map<? extends K,? extends V> m)
void putAll(MultiMap<? extends K,? extends V> m)
boolean putMany(K key, Collection<V> values)
key
- key with which the specified value is to be associatedvalues
- a collection of values to be associated with the specified
keytrue
if at least one of the provided value was not
already in the set of value mapped to the specified keySet<V> remove(K key)
boolean remove(Object key, Object value)
true
if the specified mapping was removedint range()
size()
. However, in the case where a key is mapped to more
than one value, this method will always return a value strictly
larger than size()
.int size()
range()
Collection<V> values()
Collection
view of the values contained in this map.Collection<Set<V>> valueSets()
Collection
view of the sets of values mapped to each
key in this map.Copyright © 2012. All Rights Reserved.