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.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 构造器和说明 |
|---|
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.
|
LinkedCaseInsensitiveMap(Map<String,V> columnMap) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
V |
compute(String key,
BiFunction<? super String,? super V,? extends V> remappingFunction) |
V |
computeIfAbsent(String key,
Function<? super String,? extends V> mappingFunction) |
V |
computeIfPresent(String key,
BiFunction<? super String,? super V,? extends V> remappingFunction) |
boolean |
containsKey(Object key) |
protected String |
convertKey(String key)
Convert the given key to a case-insensitive key.
|
V |
get(Object key) |
V |
merge(String key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction) |
V |
put(String key,
V value) |
void |
putAll(Map<? extends String,? extends V> m) |
V |
putIfAbsent(String key,
V value) |
V |
remove(Object key) |
containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesequals, hashCode, toStringpublic LinkedCaseInsensitiveMap()
String.toLowerCase()public LinkedCaseInsensitiveMap(Locale locale)
locale - the Locale to use for lower-case conversionString.toLowerCase(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(Locale)public V putIfAbsent(String key, V value)
putIfAbsent 在接口中 Map<String,V>putIfAbsent 在类中 HashMap<String,V>public V computeIfAbsent(String key, Function<? super String,? extends V> mappingFunction)
computeIfAbsent 在接口中 Map<String,V>computeIfAbsent 在类中 HashMap<String,V>public V computeIfPresent(String key, BiFunction<? super String,? super V,? extends V> remappingFunction)
computeIfPresent 在接口中 Map<String,V>computeIfPresent 在类中 HashMap<String,V>public V compute(String key, BiFunction<? super String,? super V,? extends V> remappingFunction)
public V merge(String key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
public boolean containsKey(Object key)
containsKey 在接口中 Map<String,V>containsKey 在类中 HashMap<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 keyString.toLowerCase(Locale)Copyright © 2022. All rights reserved.