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. Removes all of the mappings from this map (optional operation). |
| 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. If the specified key is not already associated with a value (or is mapped
to |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. Returns |
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. Returns |
| 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. Returns a |
| public boolean | equals(Object
object to be compared for equality with this map other)Overrides java. Implements java. Compares the specified object with this map for equality. |
| public void | forEach(BiConsumer<? super String, ? super V>
The action to be performed for each entry action)Overrides default java. Performs the given action for each entry in this map until all entries have been processed or the action throws an exception. |
| public V | get(Object
the key whose associated value is to be returned key)Implements java. Returns the value to which the specified key is mapped,
or |
| 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. Returns the value to which the specified key is mapped, or
|
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map. |
| 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. Associates the specified value with the specified key in this map (optional operation). |
| public void | putAll(Map<? extends String, ? extends V>
mappings to be stored in this map map)Implements java. Copies all of the mappings from the specified map to this map (optional operation). |
| 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. If the specified key is not already associated with a value (or is mapped
to |
| public V | remove(Object
key whose mapping is to be removed from the map key)Implements java. Removes the mapping for a key from this map if it is present (optional operation). |
| 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. Returns a |