Package jmri
Class ReferenceNotNull<E>
java.lang.Object
jmri.ReferenceNotNull<E>
- Type Parameters:
E- the type of the reference
A reference to an object where the object must not be null.
It's a faster replacement for AtomicReference when thread safety is not
needed.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance of Reference.ReferenceNotNull(E ref) Create an instance of Reference. -
Method Summary
-
Constructor Details
-
ReferenceNotNull
public ReferenceNotNull()Create an instance of Reference. -
ReferenceNotNull
Create an instance of Reference.- Parameters:
ref- the reference
-
-
Method Details
-
set
Set the reference.- Parameters:
ref- the new reference
-
get
Return the reference.- Returns:
- the reference
-