|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap<K,V> java.util.LinkedHashMap<String,V> org.springframework.util.LinkedCaseInsensitiveMap<V>
public class LinkedCaseInsensitiveMap<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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
LinkedCaseInsensitiveMap()
Create a new LinkedCaseInsensitiveMap for the default Locale. |
|
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. |
|
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. |
|
LinkedCaseInsensitiveMap(Locale locale)
Create a new LinkedCaseInsensitiveMap that stores lower-case keys according to the given Locale. |
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
protected String |
convertKey(String key)
Convert the given key to a case-insensitive key. |
V |
get(Object key)
|
V |
put(String key,
V value)
|
void |
putAll(Map<? extends String,? extends V> map)
|
V |
remove(Object key)
|
Methods inherited from class java.util.LinkedHashMap |
---|
containsValue, removeEldestEntry |
Methods inherited from class java.util.HashMap |
---|
clone, entrySet, isEmpty, keySet, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
entrySet, equals, hashCode, isEmpty, keySet, size, values |
Constructor Detail |
---|
public LinkedCaseInsensitiveMap()
String.toLowerCase()
public LinkedCaseInsensitiveMap(Locale locale)
locale
- the Locale to use for lower-case conversionString.toLowerCase(java.util.Locale)
public LinkedCaseInsensitiveMap(int initialCapacity)
LinkedHashMap
with the given initial capacity and stores lower-case keys according
to the default Locale.
initialCapacity
- the initial capacityString.toLowerCase()
public LinkedCaseInsensitiveMap(int initialCapacity, Locale locale)
LinkedHashMap
with the given initial capacity and stores lower-case keys according
to the given Locale.
initialCapacity
- the initial capacitylocale
- the Locale to use for lower-case conversionString.toLowerCase(java.util.Locale)
Method Detail |
---|
public V put(String key, V value)
put
in interface Map<String,V>
put
in class HashMap<String,V>
public void putAll(Map<? extends String,? extends V> map)
putAll
in interface Map<String,V>
putAll
in class HashMap<String,V>
public boolean containsKey(Object key)
containsKey
in interface Map<String,V>
containsKey
in class HashMap<String,V>
public V get(Object key)
get
in interface Map<String,V>
get
in class LinkedHashMap<String,V>
public V remove(Object key)
remove
in interface Map<String,V>
remove
in class HashMap<String,V>
public void clear()
clear
in interface Map<String,V>
clear
in class LinkedHashMap<String,V>
protected String convertKey(String key)
The default implementation converts the key to lower-case according to this Map's Locale.
key
- the user-specified key
String.toLowerCase(java.util.Locale)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |