public class DefaultMultiMapState<K,V> extends Object implements MultiMapState<K,V>
| Constructor and Description |
|---|
DefaultMultiMapState() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the map.
|
boolean |
containsEntry(K key,
V value)
Returns a boolean indicating whether the map contains an entry.
|
boolean |
containsKey(K key)
Returns a boolean indicating whether the map contains a key.
|
boolean |
containsValue(V value)
Returns a boolean indicating whether the map contains a value.
|
Set<Map.Entry<K,V>> |
entrySet()
Returns a set of entries in the map.
|
Collection<V> |
get(K key)
Gets a value from the map.
|
Collection<V> |
getOrDefault(K key,
Collection<V> defaultValue)
Gets a key from the map or returns a default value.
|
void |
init(net.kuujo.copycat.state.StateContext<MultiMapState<K,V>> context)
Initializes the multimap state.
|
boolean |
isEmpty()
Returns a boolean indicating whether the map is empty.
|
Set<K> |
keySet()
Returns a set of keys in the map.
|
Collection<V> |
put(K key,
V value)
Puts a value in the map.
|
void |
putAll(Map<? extends K,? extends Collection<V>> m)
Puts a collection of values in the map.
|
Collection<V> |
remove(K key)
Removes a key from the map.
|
boolean |
remove(K key,
V value)
Removes an entry from the map.
|
Collection<V> |
replace(K key,
Collection<V> value)
Replaces a key in the map.
|
boolean |
replace(K key,
V oldValue,
V newValue)
Replaces a value in the map.
|
void |
replaceAll(java.util.function.BiFunction<? super K,? super Collection<V>,? extends Collection<V>> function)
Replaces a set of keys in the map.
|
int |
size()
Returns the map size.
|
Collection<V> |
values()
Returns a set of values in the map.
|
public void init(net.kuujo.copycat.state.StateContext<MultiMapState<K,V>> context)
MultiMapStateinit in interface MultiMapState<K,V>context - The multimap state context.public int size()
MultiMapStatesize in interface MultiMapState<K,V>public boolean isEmpty()
MultiMapStateisEmpty in interface MultiMapState<K,V>public boolean containsKey(K key)
MultiMapStatecontainsKey in interface MultiMapState<K,V>public boolean containsValue(V value)
MultiMapStatecontainsValue in interface MultiMapState<K,V>public boolean containsEntry(K key, V value)
MultiMapStatecontainsEntry in interface MultiMapState<K,V>public Collection<V> get(K key)
MultiMapStateget in interface MultiMapState<K,V>public Collection<V> put(K key, V value)
MultiMapStateput in interface MultiMapState<K,V>public Collection<V> remove(K key)
MultiMapStateremove in interface MultiMapState<K,V>public boolean remove(K key, V value)
MultiMapStateremove in interface MultiMapState<K,V>public void putAll(Map<? extends K,? extends Collection<V>> m)
MultiMapStateputAll in interface MultiMapState<K,V>public void clear()
MultiMapStateclear in interface MultiMapState<K,V>public Set<K> keySet()
MultiMapStatekeySet in interface MultiMapState<K,V>public Collection<V> values()
MultiMapStatevalues in interface MultiMapState<K,V>public Set<Map.Entry<K,V>> entrySet()
MultiMapStateentrySet in interface MultiMapState<K,V>public Collection<V> getOrDefault(K key, Collection<V> defaultValue)
MultiMapStategetOrDefault in interface MultiMapState<K,V>public void replaceAll(java.util.function.BiFunction<? super K,? super Collection<V>,? extends Collection<V>> function)
MultiMapStatereplaceAll in interface MultiMapState<K,V>public boolean replace(K key, V oldValue, V newValue)
MultiMapStatereplace in interface MultiMapState<K,V>public Collection<V> replace(K key, Collection<V> value)
MultiMapStatereplace in interface MultiMapState<K,V>Copyright © 2013-2015. All Rights Reserved.