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 java.util.Map} operations aresupported.
However, this {@link java.util.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} toprovide synchronized access to a ReferenceMap
.
@deprecated use {@link org.apache.commons.collections.map.ReferenceIdentityMap} instead.
@author Andy Malakov
@version $Id: ReferenceMap.java,v 1.6.2.2 2005/12/21 22:27:47 tomdz Exp $
|
|
|
|