|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.util.LinkedMultiValueMap<K,V>
public class LinkedMultiValueMap<K,V>
Simple implementation of 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LinkedMultiValueMap()
LinkedHashMap
.
public LinkedMultiValueMap(int initialCapacity)
LinkedHashMap
with the given initial capacity.
initialCapacity
- the initial capacitypublic LinkedMultiValueMap(Map<K,List<V>> otherMap)
otherMap
- the Map whose mappings are to be placed in this MapMethod Detail |
---|
public void add(K key, V value)
MultiValueMap
add
in interface MultiValueMap<K,V>
key
- the keyvalue
- the value to be addedpublic V getFirst(K key)
MultiValueMap
getFirst
in interface MultiValueMap<K,V>
key
- the key
null
public void set(K key, V value)
MultiValueMap
set
in interface MultiValueMap<K,V>
key
- the keyvalue
- the value to setpublic void setAll(Map<K,V> values)
MultiValueMap
setAll
in interface MultiValueMap<K,V>
values
- the values.public Map<K,V> toSingleValueMap()
MultiValueMap
MultiValueMap
.
toSingleValueMap
in interface MultiValueMap<K,V>
public int size()
size
in interface Map<K,List<V>>
public boolean isEmpty()
isEmpty
in interface Map<K,List<V>>
public boolean containsKey(Object key)
containsKey
in interface Map<K,List<V>>
public boolean containsValue(Object value)
containsValue
in interface Map<K,List<V>>
public List<V> get(Object key)
get
in interface Map<K,List<V>>
public List<V> put(K key, List<V> value)
put
in interface Map<K,List<V>>
public List<V> remove(Object key)
remove
in interface Map<K,List<V>>
public void putAll(Map<? extends K,? extends List<V>> m)
putAll
in interface Map<K,List<V>>
public void clear()
clear
in interface Map<K,List<V>>
public Set<K> keySet()
keySet
in interface Map<K,List<V>>
public Collection<List<V>> values()
values
in interface Map<K,List<V>>
public Set<Map.Entry<K,List<V>>> entrySet()
entrySet
in interface Map<K,List<V>>
public boolean equals(Object obj)
equals
in interface Map<K,List<V>>
equals
in class Object
public int hashCode()
hashCode
in interface Map<K,List<V>>
hashCode
in class Object
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |