K
- the type of keys maintained by this multimapV
- the type of mapped valuespublic interface MultimapState<K,V> extends State
ReadableState
cell mapping keys to bags of values. Keys are considered equivalent if
their structural values are equivalent, see Coder.structuralValue(T)
for additional details.
Implementations of this form of state are expected to implement multimap operations efficiently as supported by some associated backing key-value store.
Modifier and Type | Method and Description |
---|---|
ReadableState<java.lang.Boolean> |
containsKey(K key)
Returns a
ReadableState whose ReadableState.read() method will return true if
this multimap contains the specified key at the point when that ReadableState.read() call
returns. |
ReadableState<java.lang.Iterable<java.util.Map.Entry<K,V>>> |
entries()
Returns an
Iterable over all key-value pairs contained in this multimap. |
ReadableState<java.lang.Iterable<V>> |
get(K key)
A deferred lookup, returns an empty iterable if the item is not found.
|
ReadableState<java.lang.Boolean> |
isEmpty()
Returns a
ReadableState whose ReadableState.read() method will return true if
this state is empty at the point when that ReadableState.read() call returns. |
ReadableState<java.lang.Iterable<K>> |
keys()
Returns an
Iterable over the keys contained in this multimap. |
void |
put(K key,
V value)
Associates the specified value with the specified key in this multimap.
|
void |
remove(K key)
Removes all values associated with the key from this multimap.
|
void put(K key, V value)
Changes will not be reflected in the results returned by previous calls to ReadableState.read()
on the results any of the reading methods(get(K)
, keys()
,
entries()
).
ReadableState<java.lang.Iterable<V>> get(K key)
A user is encouraged to call get
for all relevant keys and call readLater()
on the results.
When read
is called, a particular state implementation is encouraged to perform all
pending reads in a single batch.
void remove(K key)
Changes will not be reflected in the results returned by previous calls to ReadableState.read()
on the results of any of the reading methods(get(K)
, keys()
,
entries()
).
ReadableState<java.lang.Iterable<K>> keys()
Iterable
over the keys contained in this multimap.ReadableState<java.lang.Iterable<java.util.Map.Entry<K,V>>> entries()
Iterable
over all key-value pairs contained in this multimap.ReadableState<java.lang.Boolean> containsKey(K key)
ReadableState
whose ReadableState.read()
method will return true if
this multimap contains the specified key at the point when that ReadableState.read()
call
returns.ReadableState<java.lang.Boolean> isEmpty()
ReadableState
whose ReadableState.read()
method will return true if
this state is empty at the point when that ReadableState.read()
call returns.