Class SoftReferenceWithKey
java.lang.Object
java.lang.ref.Reference
java.lang.ref.SoftReference
org.apache.xmlgraphics.image.loader.util.SoftReferenceWithKey
Special SoftReference subclass that holds an additional key object that can be used to remove
a reference from a Map once the referenced object is collected, for example.
-
Constructor Summary
ConstructorsConstructorDescriptionSoftReferenceWithKey
(Object referent, Object key, ReferenceQueue q) Creates a new SoftReference with a key. -
Method Summary
Methods inherited from class java.lang.ref.SoftReference
get
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo
-
Constructor Details
-
SoftReferenceWithKey
Creates a new SoftReference with a key.- Parameters:
referent
- object the new soft reference will refer tokey
- the key objectq
- queue the soft reference is registered with
-
-
Method Details
-
getKey
Returns the key associated with this reference.- Returns:
- the key
-