public class CaseInsensitiveMap<K,V> extends Object implements Map<K,V>
The internal CaseInsentitiveString is never exposed externally from this class. When requesting the keys or entries of this map, or calling containsKey() or get() for example, use a String as you normally would. The returned Set of keys for the keySet() and entrySet() APIs return the original Strings, not the internally wrapped CaseInsensitiveString.
Modifier and Type | Class and Description |
---|---|
static class |
CaseInsensitiveMap.CaseInsensitiveEntry<K,V>
Entry implementation that will give back a String instead of a CaseInsensitiveString
when .getKey() is called.
|
Constructor and Description |
---|
CaseInsensitiveMap() |
CaseInsensitiveMap(int initialCapacity) |
CaseInsensitiveMap(int initialCapacity,
float loadFactor) |
CaseInsensitiveMap(Map<? extends K,? extends V> map) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object other) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet()
Returns a
Set view of the keys contained in this map. |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
public CaseInsensitiveMap()
public CaseInsensitiveMap(int initialCapacity)
public CaseInsensitiveMap(int initialCapacity, float loadFactor)
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean equals(Object other)
public int hashCode()
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public Set<K> keySet()
Set
view of the keys contained in this map.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. If the map is modified
while an iteration over the set is in progress (except through
the iterator's own remove operation), the results of
the iteration are undefined. The set supports element removal,
which removes the corresponding mapping from the map, via the
Iterator.remove, Set.remove,
removeAll, retainAll, and clear
operations. It does not support the add or addAll
operations.Copyright © 2015. All rights reserved.