Package org.apache.xbean.propertyeditor
Class ReferenceIdentityMap.ReferenceEntry
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference
org.apache.xbean.propertyeditor.ReferenceIdentityMap.ReferenceEntry
- Enclosing class:
- ReferenceIdentityMap
Each entry in the Map is represented with a ReferenceEntry.
If getKey() or getValue() returns null, it means the mapping is stale and should be removed.
- Since:
- Commons Collections 3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The hash code of the keyThe next entry in the hash chainprivate Object
The value -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ReferenceEntry
(ReferenceIdentityMap parent, ReferenceIdentityMap.ReferenceEntry next, int hashCode, Object key, Object value) Creates a new entry object for the ReferenceMap. -
Method Summary
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence, refersTo
-
Field Details
-
next
The next entry in the hash chain -
hashCode
private int hashCodeThe hash code of the key -
value
The value
-
-
Constructor Details
-
ReferenceEntry
private ReferenceEntry(ReferenceIdentityMap parent, ReferenceIdentityMap.ReferenceEntry next, int hashCode, Object key, Object value) Creates a new entry object for the ReferenceMap.- Parameters:
parent
- the parent mapnext
- the next entry in the hash buckethashCode
- the hash code of the keykey
- the keyvalue
- the value
-
-
Method Details
-
getKey
Gets the key from the entry. This method dereferences weak and soft keys and thus may return null.- Returns:
- the key, which may be null if it was garbage collected
-
getValue
Gets the value from the entry. This method dereferences weak and soft value and thus may return null.- Returns:
- the value, which may be null if it was garbage collected
-
setValue
Sets the value of the entry.- Parameters:
obj
- the object to store- Returns:
- the previous value
-
purged
private void purged()Purges this entry.
-