Class SoftReferenceWithKey
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.SoftReference
-
- org.apache.xmlgraphics.image.loader.util.SoftReferenceWithKey
-
public class SoftReferenceWithKey extends java.lang.ref.SoftReference
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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
key
-
Constructor Summary
Constructors Constructor Description SoftReferenceWithKey(java.lang.Object referent, java.lang.Object key, java.lang.ref.ReferenceQueue q)
Creates a new SoftReference with a key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getKey()
Returns the key associated with this reference.
-
-
-
Constructor Detail
-
SoftReferenceWithKey
public SoftReferenceWithKey(java.lang.Object referent, java.lang.Object key, java.lang.ref.ReferenceQueue q)
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
-
-