Package io.deephaven.base.reference
Class SwappableDelegatingReference<T>
java.lang.Object
io.deephaven.base.reference.SwappableDelegatingReference<T>
- All Implemented Interfaces:
SimpleReference<T>
SimpleReference implementation that delegates to an internal SimpleReference which can be replaced
using the swapDelegate(SimpleReference, SimpleReference) method.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the referent.get()Retrieve the current referent.voidswapDelegate(@NotNull SimpleReference<T> oldDelegate, @NotNull SimpleReference<T> newDelegate) Swap the delegate assigned to this SwappableDelegatingReference.
-
Constructor Details
-
SwappableDelegatingReference
-
-
Method Details
-
swapDelegate
public void swapDelegate(@NotNull @NotNull SimpleReference<T> oldDelegate, @NotNull @NotNull SimpleReference<T> newDelegate) Swap the delegate assigned to this SwappableDelegatingReference.- Parameters:
oldDelegate- The delegate to swap outnewDelegate- The delegate to swap in- Throws:
IllegalArgumentException- ifoldDelegateis not the current delegate value
-
get
Description copied from interface:SimpleReferenceRetrieve the current referent.- Specified by:
getin interfaceSimpleReference<T>- Returns:
- The current referent, which may be null.
-
clear
public void clear()Description copied from interface:SimpleReferenceClear the referent.- Specified by:
clearin interfaceSimpleReference<T>
-