cn.wensiqun.asmsupport.utils
类 LinkedMultiValueMap<K,V>

java.lang.Object
  继承者 cn.wensiqun.asmsupport.utils.LinkedMultiValueMap<K,V>
所有已实现的接口:
MultiValueMap<K,V>, Serializable, Map<K,List<V>>

public class LinkedMultiValueMap<K,V>
extends Object
implements MultiValueMap<K,V>, Serializable

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.

从以下版本开始:
3.0
作者:
Arjen Poutsma, Juergen Hoeller
另请参见:
序列化表格

嵌套类摘要
 
从接口 java.util.Map 继承的嵌套类/接口
Map.Entry<K,V>
 
构造方法摘要
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()
           
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

LinkedMultiValueMap

public LinkedMultiValueMap()
Create a new LinkedMultiValueMap that wraps a LinkedHashMap.


LinkedMultiValueMap

public LinkedMultiValueMap(int initialCapacity)
Create a new LinkedMultiValueMap that wraps a LinkedHashMap with the given initial capacity.

参数:
initialCapacity - the initial capacity

LinkedMultiValueMap

public LinkedMultiValueMap(Map<K,List<V>> otherMap)
Copy constructor: Create a new LinkedMultiValueMap with the same mappings as the specified Map.

参数:
otherMap - the Map whose mappings are to be placed in this Map
方法详细信息

add

public void add(K key,
                V value)
从接口 MultiValueMap 复制的描述
Add the given single value to the current list of values for the given key.

指定者:
接口 MultiValueMap<K,V> 中的 add
参数:
key - the key
value - the value to be added

getFirst

public V getFirst(K key)
从接口 MultiValueMap 复制的描述
Return the first value for the given key.

指定者:
接口 MultiValueMap<K,V> 中的 getFirst
参数:
key - the key
返回:
the first value for the specified key, or null

set

public void set(K key,
                V value)
从接口 MultiValueMap 复制的描述
Set the given single value under the given key.

指定者:
接口 MultiValueMap<K,V> 中的 set
参数:
key - the key
value - the value to set

setAll

public void setAll(Map<K,V> values)
从接口 MultiValueMap 复制的描述
Set the given values under.

指定者:
接口 MultiValueMap<K,V> 中的 setAll
参数:
values - the values.

toSingleValueMap

public Map<K,V> toSingleValueMap()
从接口 MultiValueMap 复制的描述
Returns the first values contained in this MultiValueMap.

指定者:
接口 MultiValueMap<K,V> 中的 toSingleValueMap
返回:
a single value representation of this map

size

public int size()
指定者:
接口 Map<K,List<V>> 中的 size

isEmpty

public boolean isEmpty()
指定者:
接口 Map<K,List<V>> 中的 isEmpty

containsKey

public boolean containsKey(Object key)
指定者:
接口 Map<K,List<V>> 中的 containsKey

containsValue

public boolean containsValue(Object value)
指定者:
接口 Map<K,List<V>> 中的 containsValue

get

public List<V> get(Object key)
指定者:
接口 Map<K,List<V>> 中的 get

put

public List<V> put(K key,
                   List<V> value)
指定者:
接口 Map<K,List<V>> 中的 put

remove

public List<V> remove(Object key)
指定者:
接口 Map<K,List<V>> 中的 remove

putAll

public void putAll(Map<? extends K,? extends List<V>> m)
指定者:
接口 Map<K,List<V>> 中的 putAll

clear

public void clear()
指定者:
接口 Map<K,List<V>> 中的 clear

keySet

public Set<K> keySet()
指定者:
接口 Map<K,List<V>> 中的 keySet

values

public Collection<List<V>> values()
指定者:
接口 Map<K,List<V>> 中的 values

entrySet

public Set<Map.Entry<K,List<V>>> entrySet()
指定者:
接口 Map<K,List<V>> 中的 entrySet

equals

public boolean equals(Object obj)
指定者:
接口 Map<K,List<V>> 中的 equals
覆盖:
Object 中的 equals

hashCode

public int hashCode()
指定者:
接口 Map<K,List<V>> 中的 hashCode
覆盖:
Object 中的 hashCode

toString

public String toString()
覆盖:
Object 中的 toString


Copyright © 2013. All Rights Reserved.