sun.com/j2se/1.4/docs/api/java/util/WeakHashMap.html">
WeakHashMap
. However, you can also specify hard keys and weak values, or any other combination. The default constructor uses hard keys and soft values, providing a memory-sensitive cache.
The algorithms used are basically the same as those in {@link java.util.HashMap}. In particular, you can specify a load factor and capacity to suit your needs. All optional {@link Map} operations are supported.
However, this {@link Map} implementation does notallow null elements. Attempting to add a null key or or a null value to the map will raise a NullPointerException
.
As usual, this implementation is not synchronized. You can use {@link java.util.Collections#synchronizedMap} to provide synchronized access to a ReferenceMap
.
@see java.lang.ref.Reference
@deprecated Moved to map subpackage. Due to be removed in v4.0.
@since Commons Collections 2.1
@version $Revision: 1.22 $ $Date: 2004/02/18 01:15:42 $
@author Paul Jack