A case-insensitive
Map
.
As entries are added to the map, keys are converted to all lowercase. A new key is compared to existing keys by comparing
newKey.toLower()
to the lowercase values in the current
KeySet.
Null keys are supported.
The
keySet()
method returns all lowercase keys, or nulls.
Example:
Map map = new CaseInsensitiveMap(); map.put("One", "One"); map.put("Two", "Two"); map.put(null, "Three"); map.put("one", "Four");
creates a
CaseInsensitiveMap
with three entries.
map.get(null)
returns
"Three"
and
map.get("ONE")
returns
"Four".
The
Set
returned by
keySet()
equals
{"one", "two", null}.
@author Matt Hall, John Watkinson, Commons-Collections team
@version $Revision: 1.1 $ $Date: 2005/10/11 17:05:32 $
@since Commons Collections 3.0