T
- the reference value typeA
- the attachment typepublic class StrongReference<T,A> extends java.lang.Object implements Reference<T,A>
Reference.Type
Modifier and Type | Field and Description |
---|---|
private A |
attachment |
private T |
value |
Constructor and Description |
---|
StrongReference(T value) |
StrongReference(T value,
A attachment) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the reference.
|
T |
get()
Get the value, or
null 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() |
public StrongReference(T value)
public T get()
Reference
null
if the reference has been cleared.public void clear()
Reference
public A getAttachment()
Reference
getAttachment
in interface Reference<T,A>
public Reference.Type getType()
Reference
public java.lang.String toString()
toString
in class java.lang.Object