public class ObjectIdDictionary
extends java.lang.Object
Behaves similar to java.util.IdentityHashMap, but in JDK1.3 as well. Additionally the implementation keeps track of orphaned IDs by using a WeakReference to store the reference object.
Modifier and Type | Class and Description |
---|---|
private static class |
ObjectIdDictionary.IdWrapper |
private class |
ObjectIdDictionary.WeakIdWrapper |
private static interface |
ObjectIdDictionary.Wrapper |
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
map |
private java.lang.ref.ReferenceQueue |
queue |
Constructor and Description |
---|
ObjectIdDictionary() |
Modifier and Type | Method and Description |
---|---|
void |
associateId(java.lang.Object obj,
java.lang.Object id) |
private void |
cleanup() |
boolean |
containsId(java.lang.Object item) |
java.lang.Object |
lookupId(java.lang.Object obj) |
void |
removeId(java.lang.Object item) |
int |
size() |
private final java.util.Map map
private final java.lang.ref.ReferenceQueue queue
public void associateId(java.lang.Object obj, java.lang.Object id)
public java.lang.Object lookupId(java.lang.Object obj)
public boolean containsId(java.lang.Object item)
public void removeId(java.lang.Object item)
public int size()
private void cleanup()