org.apache.catalina.util
public final class ParameterMap extends java.util.HashMap
locked
property. This class can be used to safely expose
Catalina internal parameter map objects to user classes without having
to clone them in order to avoid modifications. When first created, a
ParmaeterMap
instance is not locked.Constructor and Description |
---|
ParameterMap()
Construct a new, empty map with the default initial capacity and
load factor.
|
ParameterMap(int initialCapacity)
Construct a new, empty map with the specified initial capacity and
default load factor.
|
ParameterMap(int initialCapacity,
float loadFactor)
Construct a new, empty map with the specified initial capacity and
load factor.
|
ParameterMap(java.util.Map map)
Construct a new map with the same mappings as the given map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all mappings from this map.
|
boolean |
isLocked()
Return the locked state of this parameter map.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associate the specified value with the specified key in this map.
|
void |
putAll(java.util.Map map)
Copy all of the mappings from the specified map to this one.
|
java.lang.Object |
remove(java.lang.Object key)
Remove the mapping for this key from the map if present.
|
void |
setLocked(boolean locked)
Set the locked state of this parameter map.
|
clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, size, values
public ParameterMap()
public ParameterMap(int initialCapacity)
initialCapacity
- The initial capacity of this mappublic ParameterMap(int initialCapacity, float loadFactor)
initialCapacity
- The initial capacity of this maploadFactor
- The load factor of this mappublic ParameterMap(java.util.Map map)
map
- Map whose contents are dupliated in the new mappublic boolean isLocked()
public void setLocked(boolean locked)
locked
- The new locked statepublic void clear()
clear
in interface java.util.Map
clear
in class java.util.HashMap
java.lang.IllegalStateException
- if this map is currently lockedpublic java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
put
in class java.util.HashMap
key
- Key with which the specified value is to be associatedvalue
- Value to be associated with the specified keynull
if there was no mapping for keyjava.lang.IllegalStateException
- if this map is currently lockedpublic void putAll(java.util.Map map)
putAll
in interface java.util.Map
putAll
in class java.util.HashMap
map
- Mappings to be stored into this mapjava.lang.IllegalStateException
- if this map is currently lockedpublic java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
remove
in class java.util.HashMap
key
- Key whose mapping is to be removed from the mapnull
if there was no mapping for that keyjava.lang.IllegalStateException
- if this map is currently lockedCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.