Top Description Fields Constructors Methods
org.jboss.modules.ref

public Class WeakReference<T, A>

extends WeakReference<T>
implements Reference<T, A>, Reapable<T, A>
Class Inheritance
All Implemented Interfaces
org.jboss.modules.ref.Reapable, org.jboss.modules.ref.Reference
Type Parameters
<T>
the reference value type
<A>
the attachment type
Imports
java.lang.ref.ReferenceQueue

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
java.lang.ref.WeakReference

Field Summary

Modifier and TypeField and Description
private final A
private final Reaper<T, A>

Constructor Summary

AccessConstructor and Description
public
WeakReference(final T referent)

public
WeakReference(final T referent, final A attachment)

public
WeakReference(final T referent, final A attachment, final ReferenceQueue<? super T> q)

public
WeakReference(final T referent, final A attachment, final Reaper<T, A> reaper)

Method Summary

Modifier and TypeMethod and Description
public A
getAttachment()

Implements org.jboss.modules.ref.Reference.getAttachment.

Get the attachment, if any.
public Reaper<T, A>
getReaper()

Implements org.jboss.modules.ref.Reapable.getReaper.

Get the associated reaper.
public Reference.Type
getType()

Implements org.jboss.modules.ref.Reference.getType.

Get the type of the reference.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

attachmentback to summary
private final A attachment
reaperback to summary
private final Reaper<T, A> reaper

Constructor Detail

WeakReferenceback to summary
public WeakReference(final T referent)
WeakReferenceback to summary
public WeakReference(final T referent, final A attachment)
WeakReferenceback to summary
public WeakReference(final T referent, final A attachment, final ReferenceQueue<? super T> q)
WeakReferenceback to summary
public WeakReference(final T referent, final A attachment, final Reaper<T, A> reaper)

Method Detail

getAttachmentback to summary
public A getAttachment()

Implements org.jboss.modules.ref.Reference.getAttachment.

Doc from org.jboss.modules.ref.Reference.getAttachment.

Get the attachment, if any.

Returns:A

the attachment

getReaperback to summary
public Reaper<T, A> getReaper()

Implements org.jboss.modules.ref.Reapable.getReaper.

Doc from org.jboss.modules.ref.Reapable.getReaper.

Get the associated reaper.

Returns:Reaper<T, A>

the reaper

getTypeback to summary
public Reference.Type getType()

Implements org.jboss.modules.ref.Reference.getType.

Doc from org.jboss.modules.ref.Reference.getType.

Get the type of the reference.

Returns:Reference.Type

the type

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.