serp.util
Class WeakValueMap
java.lang.Object
|
+--serp.util.RefValueMap
|
+--serp.util.WeakValueMap
- All Implemented Interfaces:
- Map, RefMap
Deprecated. Replaced by the ReferenceMap
.
- public class WeakValueMap
- extends RefValueMap
Map implementation in which the values are held as weak references.
Expired values are removed from the map before any mutator methods;
removing before accessor methods can lead to
ConcurrentModificationException
s. Thus, the following methods may
produce results which include key/value pairs that have expired:
size
isEmpty
containsKey
keySet.size,contains,isEmpty
entrySet.size,contains,isEmpty
values.size,contains,isEmpty
By default, all methods are delegated to the internal map provided at
construction. Thus, the hashing algorithm, ordering, etc of the given
map will be preserved. Performance is similar to that of the internal
map instance.
Constructor Summary |
WeakValueMap()
Deprecated. Equivalent to WeakValueMap (new HashMap ()) . |
WeakValueMap(Map map)
Deprecated. Construct a WeakValueMap with the given interal map. |
Methods inherited from class serp.util.RefValueMap |
clear, containsKey, containsValue, entrySet, equals, get, isEmpty, keySet, makeHard, makeReference, put, putAll, remove, removedReference, size, toString, values |
Methods inherited from interface java.util.Map |
hashCode |
WeakValueMap
public WeakValueMap()
- Deprecated.
- Equivalent to
WeakValueMap (new HashMap ())
.
WeakValueMap
public WeakValueMap(Map map)
- Deprecated.
- Construct a WeakValueMap with the given interal map. The internal
map will be cleared. It should not be accessed in any way after being
given to this constructor; this map will 'inherit' its behavior,
however. For example, if the given map is a
LinkedHashMap
,
the RefValueMap.values()
method of this map will return values in
insertion order.
createRefMapValue
protected RefValueMap.RefMapValue createRefMapValue(Object key,
Object value,
ReferenceQueue queue)
- Deprecated.
- Description copied from class:
RefValueMap
- Create a weak or soft reference to hold the given value.
- Overrides:
createRefMapValue
in class RefValueMap
Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.