Class ReferenceDisposable<T>
java.lang.Object
java.util.concurrent.atomic.AtomicReference<T>
io.reactivex.rxjava3.disposables.ReferenceDisposable<T>
- Type Parameters:
T- the type contained
- All Implemented Interfaces:
Disposable, Serializable
- Direct Known Subclasses:
ActionDisposable, AutoCloseableDisposable, RunnableDisposable, SubscriptionDisposable
Base class for Disposable containers that manage some other type that
has to be run when the container is disposed.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddispose()Dispose the resource, the operation should be idempotent.final booleanReturns true if this resource has been disposed.protected abstract voidonDisposed(T value) Methods inherited from class AtomicReference
accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
ReferenceDisposable
ReferenceDisposable(T value)
-
-
Method Details
-
onDisposed
-
dispose
public final void dispose()Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-
isDisposed
public final boolean isDisposed()Description copied from interface:DisposableReturns true if this resource has been disposed.- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if this resource has been disposed
-