Class ObservableReplay.InnerDisposable<T>
- java.lang.Object
-
- java.lang.Number
-
- java.util.concurrent.atomic.AtomicInteger
-
- io.reactivex.rxjava3.internal.operators.observable.ObservableReplay.InnerDisposable<T>
-
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
Disposable
,java.io.Serializable
- Enclosing class:
- ObservableReplay<T>
static final class ObservableReplay.InnerDisposable<T> extends java.util.concurrent.atomic.AtomicInteger implements Disposable
A Disposable that manages the disposed state of a child Observer in thread-safe manner.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
cancelled
(package private) Observer<? super T>
child
The actual child subscriber.(package private) java.lang.Object
index
Holds an object that represents the current location in the buffer.(package private) ObservableReplay.ReplayObserver<T>
parent
The parent subscriber-to-source used to allow removing the child in case of child dispose() call.private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description InnerDisposable(ObservableReplay.ReplayObserver<T> parent, Observer<? super T> child)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Dispose the resource, the operation should be idempotent.(package private) <U> U
index()
Convenience method to auto-cast the index object.boolean
isDisposed()
Returns true if this resource has been disposed.-
Methods inherited from class java.util.concurrent.atomic.AtomicInteger
accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
parent
final ObservableReplay.ReplayObserver<T> parent
The parent subscriber-to-source used to allow removing the child in case of child dispose() call.
-
index
java.lang.Object index
Holds an object that represents the current location in the buffer. Guarded by the emitter loop.
-
cancelled
volatile boolean cancelled
-
-
Constructor Detail
-
InnerDisposable
InnerDisposable(ObservableReplay.ReplayObserver<T> parent, Observer<? super T> child)
-
-
Method Detail
-
isDisposed
public boolean isDisposed()
Description copied from interface:Disposable
Returns true if this resource has been disposed.- Specified by:
isDisposed
in interfaceDisposable
- Returns:
- true if this resource has been disposed
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
index
<U> U index()
Convenience method to auto-cast the index object.- Type Parameters:
U
- type index to be casted to- Returns:
- the index Object or null
-
-