title: Java Weak Hash Map - Need to remove entry based on weakness of value, not key
body: <p>So the Java <code>WeakHashMap</code> lets one create a map whose entries are removed if its keys become weak.  But how can I create a Map whose entries are removed when the <em>values</em> in the map become weak?  The reason I want to use a map is as a Global Hash Table which keeps track of objects according to their ID's.</p>
  
  <pre><code>ID ---&gt;  Object Address
  
  Key ---&gt; Value
  </code></pre>
  
  <p>(Where <code>ID</code> is a text string)</p>
  
  <p>I want key-value pairs to be removed when the object addresses become weak, not the Strings that point to them.  Anyone any thoughts on this?</p>