Key
- Value
- public class MultiMap<Key,Value>
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
MultiMap() |
MultiMap(boolean threadsafe) |
MultiMap(boolean threadsafe,
boolean usesets) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(Key k,
Value v) |
boolean |
containsKey(Key k) |
boolean |
containsValue(Value v) |
protected java.util.Collection<Value> |
createCollection() |
java.util.Collection<Value> |
get(Key key)
returns a mutable set of values connected to the key; if no value is
connected, returns an immutable empty set
|
java.util.Set<Value> |
getAllValues() |
boolean |
isValueSetsEqual() |
java.util.Set<Key> |
keySet() |
boolean |
put(Key key,
Value value) |
void |
putAll(Key k,
java.util.Collection<Value> v) |
void |
putAll(MultiMap<Key,Value> otherMap) |
boolean |
remove(Key key)
removes the set of values connected to the key
|
boolean |
remove(Key key,
Value value)
removes the value connected to the key; if there is more than one value
connected to the key, only one is removed
|
void |
setEntry(Key key,
java.util.Collection<Value> values) |
int |
size() |
java.lang.String |
toString() |
public MultiMap()
public MultiMap(boolean threadsafe)
public MultiMap(boolean threadsafe, boolean usesets)
protected java.util.Collection<Value> createCollection()
public void setEntry(Key key, java.util.Collection<Value> values)
key
- values
- public java.util.Collection<Value> get(Key key)
key
- public java.util.Set<Key> keySet()
public java.util.Set<Value> getAllValues()
public boolean remove(Key key)
key
- public boolean remove(Key key, Value value)
key
- value
- public int size()
public boolean contains(Key k, Value v)
k
- v
- public boolean containsKey(Key k)
k
- public boolean containsValue(Value v)
v
- public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isValueSetsEqual()