K
- keyV
- valuepublic class IdentityMultiMap<K,V> extends Object implements Serializable
Constructor and Description |
---|
IdentityMultiMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(K k,
V v) |
boolean |
containsKey(K k) |
boolean |
containsValue(V v) |
Collection<V> |
get(K key)
returns a mutable set of values connected to the key; if no value is connected, returns an
immutable empty set
|
Set<V> |
getAllValues() |
boolean |
isValueSetsEqual() |
Set<K> |
keySet() |
boolean |
put(K key,
V value) |
void |
putAll(IdentityMultiMap<K,V> otherMap) |
void |
putAll(K k,
Collection<V> v) |
boolean |
remove(K key)
removes the set of values connected to the key
|
boolean |
remove(K key,
V 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(K key,
Collection<V> values) |
int |
size() |
String |
toString() |
public boolean put(K key, V value)
key
- keyvalue
- valuepublic void setEntry(K key, Collection<V> values)
key
- keyvalues
- valuespublic Collection<V> get(K key)
key
- keypublic boolean remove(K key)
key
- keypublic boolean remove(K key, V value)
key
- keyvalue
- valuepublic int size()
public boolean contains(K k, V v)
k
- keyv
- valuepublic boolean containsKey(K k)
k
- keypublic boolean containsValue(V v)
v
- valuepublic void clear()
public void putAll(IdentityMultiMap<K,V> otherMap)
otherMap
- map to copy frompublic void putAll(K k, Collection<V> v)
k
- kv
- vpublic boolean isValueSetsEqual()
Copyright © 2020 The University of Manchester. All rights reserved.