You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Jack, Paul" <pj...@sfaf.org> on 2002/05/23 23:04:40 UTC

[SUBMIT] org.apache.commons.collections.ReferenceMap

Hi all,

Had the idea for this in the thread about SoftRefHashMap,
decided to code it up, as in the past I've often required
maps with phantom keys or values.  (Usually I just 
implemented them by manually placing the references in the
map; but then you have do painful things every time you
iterate...)

The class differs substantially from SoftRefHashMap in 
that it can be configured to use phantom references for
values; and it can be configured to use soft, weak or
phantom keys as well.

The code's based on java.util.WeakHashMap, so it should
be solid.  I'm putting together a junit test, so far 
everything looks good.

Since this class can be configured to act like SoftRefHashMap,
it might make sense to deprecate SoftRefHashMap, for all
the reasons Christopher Marshall has outlined.  

-Paul