|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.MapWrapper
org.pf.util.CaseInsensitiveKeyMap
public class CaseInsensitiveKeyMap
This class provides a map that treats all keys as case-insensitive strings. That means, the methods get(key) and containsKey(key) will find entries regardless of the keys case. Be aware the this is to some degree NOT an exact implementation of the Map interface. Iterators on the keys and values are NOT backed by the corresponding collection. That means that particularly a Collections.synchronizedMap() doesn't work with an instance of this class!
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
CaseInsensitiveKeyMap()
Initialize the new instance with default values. |
|
CaseInsensitiveKeyMap(int initialCapacity)
Initialize the new instance with an initial capacity. |
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.Object key)
This method returns true, if the given key can be found in this map. |
boolean |
containsValue(java.lang.Object value)
This method returns true, if the given value is a value of any entry in this map. |
java.util.Set |
entrySet()
This method automatically touches every entry, so that its expire period starts anew. |
java.lang.Object |
get(java.lang.Object key)
Returns the object that was registered under the specified key. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts the given value under the specified key into the map. |
void |
putAll(java.util.Map map)
Each entry of the given map will be added. |
java.lang.Object |
remove(java.lang.Object key)
Removes the entry with the specified key. |
java.util.Collection |
values()
Returns all values of the map. |
| Methods inherited from class org.pf.util.MapWrapper |
|---|
clear, isEmpty, keySet, size |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public CaseInsensitiveKeyMap()
public CaseInsensitiveKeyMap(int initialCapacity)
initialCapacity - Defines how many "slots" for elements are created initially| Method Detail |
|---|
public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapcontainsKey in class MapWrapperMap.containsKey(Object)public java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class MapWrapperMap.get(Object)
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class MapWrapperMap.put(Object, Object)public void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in class MapWrapperMap.putAll(Map)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.MapcontainsValue in class MapWrapperMap.containsValue(Object)public java.util.Collection values()
values in interface java.util.Mapvalues in class MapWrapperMap.values()public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class MapWrapperMap.remove(Object)public java.util.Set entrySet()
entrySet in interface java.util.MapentrySet in class MapWrapperMap.entrySet()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||