Class ObservableCache.CacheDisposable<T>
- java.lang.Object
-
- java.lang.Number
-
- java.util.concurrent.atomic.AtomicInteger
-
- io.reactivex.rxjava3.internal.operators.observable.ObservableCache.CacheDisposable<T>
-
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
Disposable
,java.io.Serializable
- Enclosing class:
- ObservableCache<T>
static final class ObservableCache.CacheDisposable<T> extends java.util.concurrent.atomic.AtomicInteger implements Disposable
Hosts the downstream consumer and its current requested and replay states.this
holds the work-in-progress counter for the serialized replay.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
disposed
(package private) Observer<? super T>
downstream
(package private) long
index
(package private) ObservableCache.Node<T>
node
(package private) int
offset
(package private) ObservableCache<T>
parent
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description CacheDisposable(Observer<? super T> downstream, ObservableCache<T> parent)
Constructs a new instance with the actual downstream consumer and the parent cache object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Dispose the resource, the operation should be idempotent.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 ObservableCache<T> parent
-
node
ObservableCache.Node<T> node
-
offset
int offset
-
index
long index
-
disposed
volatile boolean disposed
-
-
Constructor Detail
-
CacheDisposable
CacheDisposable(Observer<? super T> downstream, ObservableCache<T> parent)
Constructs a new instance with the actual downstream consumer and the parent cache object.- Parameters:
downstream
- the actual consumerparent
- the parent that holds onto the cached items
-
-
Method Detail
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
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
-
-