public class LinkedMultiValueMap<K,V> extends Object implements MultiValueMap<K,V>, Serializable
MultiValueMap that wraps a
LinkedHashMap, storing multiple values in a LinkedList.
This Map implementation is generally not thread-safe. It is primarily designed for data structures exposed from request objects, for use in a single thread only.
| 构造器和说明 |
|---|
LinkedMultiValueMap()
Create a new LinkedMultiValueMap that wraps a
LinkedHashMap. |
LinkedMultiValueMap(int initialCapacity)
Create a new LinkedMultiValueMap that wraps a
LinkedHashMap with
the given initial capacity. |
LinkedMultiValueMap(Map<K,List<V>> otherMap)
Copy constructor: Create a new LinkedMultiValueMap with the same mappings
as the specified Map.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(K key,
V value)
Add the given single value to the current list of values for the given
key.
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,List<V>>> |
entrySet() |
boolean |
equals(Object obj) |
List<V> |
get(Object key) |
V |
getFirst(K key)
Return the first value for the given key.
|
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
List<V> |
put(K key,
List<V> value) |
void |
putAll(Map<? extends K,? extends List<V>> m) |
List<V> |
remove(Object key) |
void |
set(K key,
V value)
Set the given single value under the given key.
|
void |
setAll(Map<K,V> values)
Set the given values under.
|
int |
size() |
Map<K,V> |
toSingleValueMap()
Returns the first values contained in this
MultiValueMap. |
String |
toString() |
Collection<List<V>> |
values() |
public LinkedMultiValueMap()
LinkedHashMap.public LinkedMultiValueMap(int initialCapacity)
LinkedHashMap with
the given initial capacity.initialCapacity - the initial capacitypublic void add(K key, V value)
MultiValueMapadd 在接口中 MultiValueMap<K,V>key - the keyvalue - the value to be addedpublic V getFirst(K key)
MultiValueMapgetFirst 在接口中 MultiValueMap<K,V>key - the keynullpublic void set(K key, V value)
MultiValueMapset 在接口中 MultiValueMap<K,V>key - the keyvalue - the value to setpublic void setAll(Map<K,V> values)
MultiValueMapsetAll 在接口中 MultiValueMap<K,V>values - the values.public Map<K,V> toSingleValueMap()
MultiValueMapMultiValueMap.toSingleValueMap 在接口中 MultiValueMap<K,V>Copyright © 2013 The Skfiy Open Association. All Rights Reserved.