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 | |
| private class | |
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final ReferenceQueue |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| public boolean | |
| public Object | |
| public void | |
| public int |
| map | back to summary |
|---|---|
| private final Map<K, V> map | |
| queue | back to summary |
|---|---|
| private final ReferenceQueue<T> queue | |
| ObjectIdDictionary | back to summary |
|---|---|
| public ObjectIdDictionary() | |
| associateId | back to summary |
|---|---|
| public void associateId(Object obj, Object id) | |
| cleanup | back to summary |
|---|---|
| private void cleanup() | |
| containsId | back to summary |
|---|---|
| public boolean containsId(Object item) | |
| lookupId | back to summary |
|---|---|
| public Object lookupId(Object obj) | |
| removeId | back to summary |
|---|---|
| public void removeId(Object item) | |
| size | back to summary |
|---|---|
| public int size() | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final Object |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Implements com. |
| public Object | |
| public int | hashCode()
Overrides java. Implements com. |
| public String | toString()
Overrides java. Implements com. |
| hashCode | back to summary |
|---|---|
| private final int hashCode | |
| obj | back to summary |
|---|---|
| private final Object obj | |
| IdWrapper | back to summary |
|---|---|
| public IdWrapper(Object obj) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements com. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| get | back to summary |
|---|---|
| public Object get() Implements com. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements com. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements com. Doc from java. Returns a string representation of the object.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Implements com. |
| public int | hashCode()
Overrides java. Implements com. |
| public String | toString()
Overrides java. Implements com. |
| hashCode | back to summary |
|---|---|
| private final int hashCode | |
| WeakIdWrapper | back to summary |
|---|---|
| public WeakIdWrapper(Object obj) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements com. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements com. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements com. Doc from java. Returns a string representation of the object.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Object | |
| public int | |
| public String |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) | |
| get | back to summary |
|---|---|
| public Object get() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() | |
| toString | back to summary |
|---|---|
| public String toString() | |