com.foxinmy.weixin4j.util
Class LinkedCaseInsensitiveMap<V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,V>
com.foxinmy.weixin4j.util.LinkedCaseInsensitiveMap<V>
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,V>
public class LinkedCaseInsensitiveMap<V>
- extends LinkedHashMap<String,V>
LinkedHashMap variant that stores String keys in a case-insensitive
manner, for example for key-based access in a results table.
Preserves the original order as well as the original casing of keys, while
allowing for contains, get and remove calls with any case of key.
Does not support null keys.
- Since:
- 3.0
- Author:
- Juergen Hoeller
- See Also:
- Serialized Form
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap()
- Create a new LinkedCaseInsensitiveMap for the default Locale.
- See Also:
String.toLowerCase()
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap(Locale locale)
- Create a new LinkedCaseInsensitiveMap that stores lower-case keys
according to the given Locale.
- Parameters:
locale - the Locale to use for lower-case conversion- See Also:
String.toLowerCase(java.util.Locale)
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap(int initialCapacity)
- Create a new LinkedCaseInsensitiveMap that wraps a
LinkedHashMap
with the given initial capacity and stores lower-case keys according to
the default Locale.
- Parameters:
initialCapacity - the initial capacity- See Also:
String.toLowerCase()
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap(int initialCapacity,
Locale locale)
- Create a new LinkedCaseInsensitiveMap that wraps a
LinkedHashMap
with the given initial capacity and stores lower-case keys according to
the given Locale.
- Parameters:
initialCapacity - the initial capacitylocale - the Locale to use for lower-case conversion- See Also:
String.toLowerCase(java.util.Locale)
put
public V put(String key,
V value)
- Specified by:
put in interface Map<String,V>- Overrides:
put in class HashMap<String,V>
putAll
public void putAll(Map<? extends String,? extends V> map)
- Specified by:
putAll in interface Map<String,V>- Overrides:
putAll in class HashMap<String,V>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Map<String,V>- Overrides:
containsKey in class HashMap<String,V>
get
public V get(Object key)
- Specified by:
get in interface Map<String,V>- Overrides:
get in class LinkedHashMap<String,V>
remove
public V remove(Object key)
- Specified by:
remove in interface Map<String,V>- Overrides:
remove in class HashMap<String,V>
clear
public void clear()
- Specified by:
clear in interface Map<String,V>- Overrides:
clear in class LinkedHashMap<String,V>
Copyright © 2014–2017. All rights reserved.