Package org.jboss.modules.ref
Class StrongReference<T,A>
- java.lang.Object
-
- org.jboss.modules.ref.StrongReference<T,A>
-
- Type Parameters:
T- the reference value typeA- the attachment type
- All Implemented Interfaces:
Reference<T,A>
public class StrongReference<T,A> extends java.lang.Object implements Reference<T,A>
A strong reference with an attachment. Since strong references are always reachable, a reaper may not be used.- Author:
- David M. Lloyd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.modules.ref.Reference
Reference.Type
-
-
Constructor Summary
Constructors Constructor Description StrongReference(T value)StrongReference(T value, A attachment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the reference.Tget()Get the value, ornullif the reference has been cleared.AgetAttachment()Get the attachment, if any.Reference.TypegetType()Get the type of the reference.java.lang.StringtoString()
-
-
-
Method Detail
-
get
public T get()
Description copied from interface:ReferenceGet the value, ornullif the reference has been cleared.
-
clear
public void clear()
Description copied from interface:ReferenceClear the reference.
-
getAttachment
public A getAttachment()
Description copied from interface:ReferenceGet the attachment, if any.- Specified by:
getAttachmentin interfaceReference<T,A>- Returns:
- the attachment
-
getType
public Reference.Type getType()
Description copied from interface:ReferenceGet the type of the reference.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-