T - the reference value typeA - the attachment typepublic class SoftReference<T,A> extends java.lang.ref.SoftReference<T> implements Reference<T,A>, Reapable<T,A>
Reaper is given, then it will be used to asynchronously
clean up the referent.SoftReferenceReference.Type| Modifier and Type | Field and Description |
|---|---|
private A |
attachment |
private Reaper<T,A> |
reaper |
| Constructor and Description |
|---|
SoftReference(T referent) |
SoftReference(T referent,
A attachment) |
SoftReference(T referent,
A attachment,
Reaper<T,A> reaper) |
SoftReference(T referent,
A attachment,
java.lang.ref.ReferenceQueue<? super T> q) |
| Modifier and Type | Method and Description |
|---|---|
A |
getAttachment()
Get the attachment, if any.
|
Reaper<T,A> |
getReaper()
Get the associated reaper.
|
Reference.Type |
getType()
Get the type of the reference.
|
java.lang.String |
toString() |
public SoftReference(T referent)
public SoftReference(T referent, A attachment, java.lang.ref.ReferenceQueue<? super T> q)
public Reaper<T,A> getReaper()
Reapablepublic A getAttachment()
ReferencegetAttachment in interface Reference<T,A>public Reference.Type getType()
Referencepublic java.lang.String toString()
toString in class java.lang.Object