Package org.apache.axis.utils
Class LockableHashtable
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable
org.apache.axis.utils.LockableHashtable
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
This subclass of the java Hashtable allows individual
entries to be "locked" so that their values cannot be
overwritten or removed.
Note, only the put() and remove() methods have been
overridden. The clear() method still removes all
entries whether they've been locked or not.
- Author:
- James Snell (jasnell@us.ibm.com)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLockableHashtable
(int p1) LockableHashtable
(int p1, float p2) LockableHashtable
(Map p1) -
Method Summary
Modifier and TypeMethodDescriptionGet an entry from this hashtable, and if we don't find anything, defer to our parent, if any.Returns the keys in this hashtable, and its parent chainGets the parent Hashtable for this object (if any)boolean
isKeyLocked
(Object key) Returns true if a given key is in our locked listOverrides the Hashtable.put() method to mark items as not being locked.New version of the put() method that allows for explicitly marking items added to the hashtable as locked.Checks to see if an item is locked before it is removed.void
Set the parent Hashtable for this objectMethods inherited from class java.util.Hashtable
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keys, keySet, merge, putAll, putIfAbsent, rehash, remove, replace, replace, replaceAll, size, toString, values
-
Constructor Details
-
LockableHashtable
public LockableHashtable() -
LockableHashtable
public LockableHashtable(int p1, float p2) -
LockableHashtable
-
LockableHashtable
public LockableHashtable(int p1)
-
-
Method Details
-
setParent
Set the parent Hashtable for this object -
getParent
Gets the parent Hashtable for this object (if any) -
getAllKeys
Returns the keys in this hashtable, and its parent chain -
get
Get an entry from this hashtable, and if we don't find anything, defer to our parent, if any. -
put
New version of the put() method that allows for explicitly marking items added to the hashtable as locked. -
put
Overrides the Hashtable.put() method to mark items as not being locked. -
remove
Checks to see if an item is locked before it is removed. -
isKeyLocked
Returns true if a given key is in our locked list
-