K
- the type of keys maintained by this multimapV
- the type of mapped valuespublic interface MultiMap<K,V>
Map
except that a key can be bound to
multiple values. It is similar to
Map<K,Collection<V>>
, but not identical because in a
multimap, each key and value is stored as an individual entry. This means
that the iteration order and size()
will be different.
If you actually need the Map<K,Collection<V>>
semantics,
then call the map()
method.size()
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Object key)
Test if this object contains the specified key.
|
Collection<Map.Entry<K,V>> |
entries()
Get each key value pair in this multi-map.
|
V |
get(Object key)
Get the first value associated with the specified key.
|
boolean |
isEmpty()
Returns true if this
MultiMap contains no key-value
mappings. |
Set<K> |
keySet()
The set of keys in this object
|
Map<K,Collection<V>> |
map()
Represent this
MultiMap as a
Map<K,Collection<V>> data structure, where values
are grouped by key. |
int |
size()
The number of entries in this
MultiMap . |
Collection<V> |
values(Object key)
Get all the values associated with the specified key.
|
boolean containsKey(Object key)
key
- The key to search forCollection<Map.Entry<K,V>> entries()
Collection
of all Map.Entry
s in this
multi map.V get(Object key)
key
- The key to search forboolean isEmpty()
MultiMap
contains no key-value
mappings.MultiMap
contains no key-value
mappingsMap<K,Collection<V>> map()
MultiMap
as a
Map<K,Collection<V>>
data structure, where values
are grouped by key.Map
instanceint size()
MultiMap
. Note that this method
returns the number of entries, not the number of keys as a Map
would. Consider the following MultiMap
{ a = b, c = d, a = e }The
size()
of this MultiMap
is 3
. Note that
the Map.size()
value returned by the Map
instance returned
from the map()
method would be 2
, because there are
only two distinct keys.Collection<V> values(Object key)
key
- The name of the keyMultiMap
Oracle REST Data Services Plugin API version: 3.0.0.65.09.35 Copyright © 2015 Oracle Corp. All Rights Reserved.