org.jboss.modules.ref
Class WeakReference<T,A>
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<T>
org.jboss.modules.ref.WeakReference<T,A>
- Type Parameters:
T
- the reference value typeA
- the attachment type
- All Implemented Interfaces:
- Reference<T,A>
public class WeakReference<T,A>
- extends WeakReference<T>
- implements Reference<T,A>
A reapable weak reference with an attachment. If a Reaper
is given, then it will be used to asynchronously
clean up the referent.
- Author:
- David M. Lloyd
- See Also:
WeakReference
WeakReference
public WeakReference(T referent)
WeakReference
public WeakReference(T referent,
A attachment)
WeakReference
public WeakReference(T referent,
A attachment,
ReferenceQueue<? super T> q)
WeakReference
public WeakReference(T referent,
A attachment,
Reaper<T,A> reaper)
getAttachment
public A getAttachment()
- Description copied from interface:
Reference
- Get the attachment, if any.
- Specified by:
getAttachment
in interface Reference<T,A>
- Returns:
- the attachment
getType
public Reference.Type getType()
- Description copied from interface:
Reference
- Get the type of the reference.
- Specified by:
getType
in interface Reference<T,A>
- Returns:
- the type
getReaper
public Reaper<T,A> getReaper()
- Get the associated reaper.
- Returns:
- the reaper
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2011. All Rights Reserved.