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.toString().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}.
@since Commons Collections 3.0
@version $Revision: 1.4 $ $Date: 2004/02/18 01:13:19 $
@author Commons-Collections team
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|