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.
| Modifier and Type | Class and Description |
|---|---|
| private abstract class | |
| private class | |
| private class | |
| private class | |
| private class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final HashMap | |
| private transient volatile Set | |
| private transient volatile Set | |
| private final Locale | |
| private final LinkedHashMap | |
| private transient volatile Collection |
| Access | Constructor and Description |
|---|---|
| public | LinkedCaseInsensitiveMap()
Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the default Locale (by default in lower case). |
| public | LinkedCaseInsensitiveMap(Locale
the Locale to use for case-insensitive key conversion locale)Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the given Locale (in lower case). |
| public | LinkedCaseInsensitiveMap(int
the expected number of elements (with a corresponding
capacity to be derived so that no resize/rehash operations are needed) expectedSize)Create a new LinkedCaseInsensitiveMap that wraps a |
| public | LinkedCaseInsensitiveMap(int
the expected number of elements (with a corresponding
capacity to be derived so that no resize/rehash operations are needed) expectedSize, Locale the Locale to use for case-insensitive key conversion locale)Create a new LinkedCaseInsensitiveMap that wraps a |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements java. |
| public LinkedCaseInsensitiveMap | |
| public V | computeIfAbsent(String
key with which the specified value is to be associated key, Function<? super String, ? extends V> the mapping function to compute a value mappingFunction)Overrides default java. null), attempts to compute its value using the given mapping
function and enters it into this map unless null.
|
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. true if this map contains a mapping for the specified
key.
|
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. true if this map maps one or more keys to the
specified value.
|
| protected String | Returns: the key to use for storingthe user-specified key key)Convert the given key to a case-insensitive key. |
| public Set | entrySet()
Implements java. Set view of the mappings contained in this map.
|
| public boolean | equals(Object
object to be compared for equality with this map other)Overrides java. Implements java. |
| public void | forEach(BiConsumer<? super String, ? super V>
The action to be performed for each entry action)Overrides default java. |
| public V | get(Object
the key whose associated value is to be returned key)Implements java. null if this map contains no mapping for the key.
|
| public Locale | |
| public V | getOrDefault(Object
the key whose associated value is to be returned key, V the default mapping of the key defaultValue)Overrides default java. defaultValue if this map contains no mapping for the key.
|
| public int | hashCode()
Overrides java. Implements java. |
| public boolean | |
| public Set | |
| public V | put(String
key with which the specified value is to be associated key, V value to be associated with the specified key value)Implements java. |
| public void | putAll(Map<? extends String, ? extends V>
mappings to be stored in this map map)Implements java. |
| public V | putIfAbsent(String
key with which the specified value is to be associated key, V value to be associated with the specified key value)Overrides default java. null) associates it with the given value and returns
null, else returns the current value.
|
| public V | remove(Object
key whose mapping is to be removed from the map key)Implements java. |
| private String | |
| protected boolean | Returns: true for removing it, false for keeping itthe candidate entry eldestDetermine whether this map should remove the given eldest entry. |
| public int | |
| public String | |
| public Collection | values()
Implements java. Collection view of the values contained in this map.
|