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 void
clear()
Clear the reference.T
get()
Get the value, ornull
if the reference has been cleared.A
getAttachment()
Get the attachment, if any.Reference.Type
getType()
Get the type of the reference.java.lang.String
toString()
-
-
-
Method Detail
-
get
public T get()
Description copied from interface:Reference
Get the value, ornull
if the reference has been cleared.
-
clear
public void clear()
Description copied from interface:Reference
Clear the reference.
-
getAttachment
public A getAttachment()
Description copied from interface:Reference
Get the attachment, if any.- Specified by:
getAttachment
in interfaceReference<T,A>
- Returns:
- the attachment
-
getType
public Reference.Type getType()
Description copied from interface:Reference
Get the type of the reference.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-