T
- the reference value typeA
- the attachment typepublic class SoftReference<T,A> extends SoftReference<T> implements Reference<T,A>
Reaper
is given, then it will be used to asynchronously
clean up the referent.SoftReference
Reference.Type
Constructor and Description |
---|
SoftReference(T referent)
Construct a new instance.
|
SoftReference(T referent,
A attachment)
Construct a new instance.
|
SoftReference(T referent,
A attachment,
Reaper<T,A> reaper)
Construct a new instance with a reaper.
|
SoftReference(T referent,
A attachment,
ReferenceQueue<? super T> q)
Construct a new instance with an explicit reference queue.
|
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.
|
String |
toString() |
get
clear, enqueue, isEnqueued
public SoftReference(T referent)
referent
- the referentpublic SoftReference(T referent, A attachment)
referent
- the referentattachment
- the attachmentpublic SoftReference(T referent, A attachment, ReferenceQueue<? super T> q)
referent
- the referentattachment
- the attachmentq
- the reference queue to usepublic A getAttachment()
Reference
getAttachment
in interface Reference<T,A>
public Reference.Type getType()
Reference
Copyright © 2015 JBoss, a division of Red Hat, Inc.