Package org.apache.tapestry5.commons.util

# Class CaseInsensitiveMap<V>

java.lang.Object
java.util.AbstractMap<String,V>
org.apache.tapestry5.commons.util.CaseInsensitiveMap<V>

Type Parameters:
  `V` - the type of value stored

All Implemented Interfaces:
  `Serializable`, `Map<String,V>`

public class CaseInsensitiveMap<V> extends AbstractMap<String,V> implements Serializable
An mapped collection where the keys are always strings and access to values is case-insensitive. The case of keys in the map is maintained, but on any access to a key (directly or indirectly), all key comparisons are performed in a case-insensitive manner. The map implementation is intended to support a reasonably finite number (dozens or hundreds, not thousands or millions of key/value pairs. Unlike HashMap, it is based on a sorted list of entries rather than hash bucket. It is also geared towards a largely static map, one that is created and then used without modification.

See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.util.AbstractMap

  `AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>`

  ## Nested classes/interfaces inherited from interface java.util.Map

  `Map.Entry<K extends Object,V extends Object>`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CaseInsensitiveMap()`
  `CaseInsensitiveMap(int size)`
  `CaseInsensitiveMap(Map<String,? extends V> map)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  `boolean`
  `containsKey(Object key)`
  `Set<Map.Entry<String,V>>`
  `entrySet()`
  `V`
  `get(Object key)`
  `boolean`
  `isEmpty()`
  `Set<String>`
  `keySet()`
  `V`
  `put(String key, V value)`
  `V`
  `remove(Object key)`
  `int`
  `size()`

  ### Methods inherited from class java.util.AbstractMap

  `clone, containsValue, equals, hashCode, putAll, toString, values`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.Map

  `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- ## Constructor Details

  - ### CaseInsensitiveMap

    public CaseInsensitiveMap()

  - ### CaseInsensitiveMap

    public CaseInsensitiveMap(int size)

  - ### CaseInsensitiveMap

    public CaseInsensitiveMap(Map<String,? extends V> map)

- ## Method Details

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `Map<String,V>`
    Overrides:
      `clear` in class `AbstractMap<String,V>`

  - ### isEmpty

    public boolean isEmpty()
    Specified by:
      `isEmpty` in interface `Map<String,V>`
    Overrides:
      `isEmpty` in class `AbstractMap<String,V>`

  - ### size

    public int size()
    Specified by:
      `size` in interface `Map<String,V>`
    Overrides:
      `size` in class `AbstractMap<String,V>`

  - ### put

    public V put(String key, V value)
    Specified by:
      `put` in interface `Map<String,V>`
    Overrides:
      `put` in class `AbstractMap<String,V>`

  - ### containsKey

    public boolean containsKey(Object key)
    Specified by:
      `containsKey` in interface `Map<String,V>`
    Overrides:
      `containsKey` in class `AbstractMap<String,V>`

  - ### get

    public V get(Object key)
    Specified by:
      `get` in interface `Map<String,V>`
    Overrides:
      `get` in class `AbstractMap<String,V>`

  - ### remove

    public V remove(Object key)
    Specified by:
      `remove` in interface `Map<String,V>`
    Overrides:
      `remove` in class `AbstractMap<String,V>`

  - ### entrySet

    public Set<Map.Entry<String,V>> entrySet()
    Specified by:
      `entrySet` in interface `Map<String,V>`
    Specified by:
      `entrySet` in class `AbstractMap<String,V>`

  - ### keySet

    public Set<String> keySet()
    Specified by:
      `keySet` in interface `Map<String,V>`
    Overrides:
      `keySet` in class `AbstractMap<String,V>`