|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.innig.collect.CompositeMultiMap<K,V>
public class CompositeMultiMap<K,V>
A multi-map implementation which combines existing Map and Set implementations.
| Maturity: This is a 90% mature API, and a stable implementation. It performs well in formal testing, but has not undergone real-world testing. |
| Plans: There are no current plans to expand or revise this class's functionality. |
| Nested Class Summary | |
|---|---|
class |
CompositeMultiMap.Entry<EK,EV>
|
| Constructor Summary | |
|---|---|
CompositeMultiMap(java.lang.Class<? extends java.util.Map> mapClass,
java.lang.Class<? extends java.util.Set> setClass)
Creates a new empty composite multi-map. |
|
CompositeMultiMap(java.lang.Class<? extends java.util.Map> mapClass,
java.lang.Class<? extends java.util.Set> setClass,
java.util.Map<? extends K,? extends V> map)
Creates a new composite multi-map which is a shallow copy of an existing map. |
|
CompositeMultiMap(java.lang.Class<? extends java.util.Map> mapClass,
java.lang.Class<? extends java.util.Set> setClass,
MultiMap<? extends K,? extends V> multimap)
Creates a new composite multi-map which is a shallow copy of an existing multi-map. |
|
CompositeMultiMap(java.util.Map<K,java.util.Set<V>> map,
java.lang.Class<? extends java.util.Set> setClass)
|
|
CompositeMultiMap(java.util.TreeMap<K,java.util.Set<V>> map,
Factory<java.util.Set<V>> setFactory)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears all entries. |
boolean |
containsKey(K key)
Returns true if there is at least one mapping for the given key. |
boolean |
containsValue(V searchValue)
Returns true if there is at least one key which maps to the given values. |
java.util.Set<MultiMap.Entry<K,V>> |
entrySet()
Returns the set of key/value pairs in this multi-map. |
boolean |
equals(java.lang.Object other)
Two multi-maps are equal iff they contain the same key/value mappings. |
java.util.Set<V> |
get(K key)
Returns the set of values for a given key. |
int |
hashCode()
|
boolean |
isEmpty()
Returns true if there are no mappings. |
java.util.Set<K> |
keySet()
Returns the set of keys in this multi-map. |
boolean |
put(K key,
V value)
Adds a mapping from a key to a value. |
boolean |
putAll(K key,
java.util.Collection<? extends V> values)
Adds mappings from a key to several different values. |
void |
putAll(java.util.Map<? extends K,? extends V> map)
Adds all entries from a map to this multi-map. |
void |
putAll(MultiMap<? extends K,? extends V> multimap)
Adds all entries from another multi-map to this one. |
boolean |
remove(K key,
V value)
Removes a key/value mapping. |
java.util.Set<V> |
removeKey(K key)
Removes all key/value mappings for a given key. |
int |
size()
Returns the number of key/value mappings in the multi-map. |
java.lang.String |
toString()
|
java.util.Collection<V> |
values()
Returns the values in this multi-map. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeMultiMap(java.lang.Class<? extends java.util.Map> mapClass,
java.lang.Class<? extends java.util.Set> setClass)
mapClass - A class implementing Map with a no-args constructor.setClass - A class implementing Set with a no-args constructor.
public CompositeMultiMap(java.lang.Class<? extends java.util.Map> mapClass,
java.lang.Class<? extends java.util.Set> setClass,
MultiMap<? extends K,? extends V> multimap)
mapClass - A class implementing Map with a no-args constructor.setClass - A class implementing Set with a no-args constructor.multimap - The intial key/value mappings for this multimap.
public CompositeMultiMap(java.lang.Class<? extends java.util.Map> mapClass,
java.lang.Class<? extends java.util.Set> setClass,
java.util.Map<? extends K,? extends V> map)
mapClass - A class implementing Map with a no-args constructor.setClass - A class implementing Set with a no-args constructor.map - The intial key/value mappings for this multimap.
public CompositeMultiMap(java.util.Map<K,java.util.Set<V>> map,
java.lang.Class<? extends java.util.Set> setClass)
public CompositeMultiMap(java.util.TreeMap<K,java.util.Set<V>> map,
Factory<java.util.Set<V>> setFactory)
| Method Detail |
|---|
public int size()
MultiMap
size in interface MultiMap<K,V>public boolean isEmpty()
MultiMap
isEmpty in interface MultiMap<K,V>public boolean containsKey(K key)
MultiMap
containsKey in interface MultiMap<K,V>public boolean containsValue(V searchValue)
MultiMap
containsValue in interface MultiMap<K,V>public java.util.Set<V> get(K key)
MultiMap
get in interface MultiMap<K,V>
public boolean put(K key,
V value)
MultiMap
put in interface MultiMap<K,V>
public boolean putAll(K key,
java.util.Collection<? extends V> values)
MultiMap
putAll in interface MultiMap<K,V>
public boolean remove(K key,
V value)
MultiMap
remove in interface MultiMap<K,V>public java.util.Set<V> removeKey(K key)
MultiMap
removeKey in interface MultiMap<K,V>public void putAll(MultiMap<? extends K,? extends V> multimap)
MultiMap
putAll in interface MultiMap<K,V>public void putAll(java.util.Map<? extends K,? extends V> map)
MultiMap
putAll in interface MultiMap<K,V>public void clear()
MultiMap
clear in interface MultiMap<K,V>public java.util.Set<K> keySet()
MultiMap
keySet in interface MultiMap<K,V>public java.util.Collection<V> values()
MultiMap
values in interface MultiMap<K,V>public java.util.Set<MultiMap.Entry<K,V>> entrySet()
MultiMap
entrySet in interface MultiMap<K,V>public boolean equals(java.lang.Object other)
MultiMap
equals in interface MultiMap<K,V>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface MultiMap<K,V>hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||