org.apache.catalina.util
Class ParameterMap
HashMap
org.apache.catalina.util.ParameterMap
public final class ParameterMap
extends HashMap
Extended implementation of HashMap that includes a
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.
Version:
- Craig R. McClanahan
ParameterMap() - Construct a new, empty map with the default initial capacity and
load factor.
|
ParameterMap(Map map) - Construct a new map with the same mappings as the given map.
|
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.
|
void | clear() - Remove all mappings from this map.
|
boolean | isLocked() - Return the locked state of this parameter map.
|
Object | put(Object key, Object value) - Associate the specified value with the specified key in this map.
|
void | putAll(Map map) - Copy all of the mappings from the specified map to this one.
|
Object | remove(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.
|
ParameterMap
public ParameterMap()
Construct a new, empty map with the default initial capacity and
load factor.
ParameterMap
public ParameterMap(Map map)
Construct a new map with the same mappings as the given map.
map
- Map whose contents are dupliated in the new map
ParameterMap
public ParameterMap(int initialCapacity)
Construct a new, empty map with the specified initial capacity and
default load factor.
initialCapacity
- The initial capacity of this map
ParameterMap
public ParameterMap(int initialCapacity,
float loadFactor)
Construct a new, empty map with the specified initial capacity and
load factor.
initialCapacity
- The initial capacity of this maploadFactor
- The load factor of this map
clear
public void clear()
Remove all mappings from this map.
isLocked
public boolean isLocked()
Return the locked state of this parameter map.
put
public Object put(Object key,
Object value)
Associate the specified value with the specified key in this map. If
the map previously contained a mapping for this key, the old value is
replaced.
key
- Key with which the specified value is to be associatedvalue
- Value to be associated with the specified key
- The previous value associated with the specified key, or
null
if there was no mapping for key
putAll
public void putAll(Map map)
Copy all of the mappings from the specified map to this one. These
mappings replace any mappings that this map had for any of the keys
currently in the specified Map.
map
- Mappings to be stored into this map
remove
public Object remove(Object key)
Remove the mapping for this key from the map if present.
key
- Key whose mapping is to be removed from the map
- The previous value associated with the specified key, or
null
if there was no mapping for that key
setLocked
public void setLocked(boolean locked)
Set the locked state of this parameter map.
locked
- The new locked state
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.