Package io.reactivex.rxjava3.subjects
Class ReplaySubject.SizeBoundReplayBuffer<T>
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicReference<java.lang.Object>
-
- io.reactivex.rxjava3.subjects.ReplaySubject.SizeBoundReplayBuffer<T>
-
- All Implemented Interfaces:
ReplaySubject.ReplayBuffer<T>
,java.io.Serializable
- Enclosing class:
- ReplaySubject<T>
static final class ReplaySubject.SizeBoundReplayBuffer<T> extends java.util.concurrent.atomic.AtomicReference<java.lang.Object> implements ReplaySubject.ReplayBuffer<T>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
done
(package private) ReplaySubject.Node<java.lang.Object>
head
(package private) int
maxSize
private static long
serialVersionUID
(package private) int
size
(package private) ReplaySubject.Node<java.lang.Object>
tail
-
Constructor Summary
Constructors Constructor Description SizeBoundReplayBuffer(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T value)
void
addFinal(java.lang.Object notificationLite)
T
getValue()
T[]
getValues(T[] array)
void
replay(ReplaySubject.ReplayDisposable<T> rs)
int
size()
(package private) void
trim()
void
trimHead()
Replace a non-empty head node with an empty one to allow the GC of the inaccessible old value.-
Methods inherited from class java.util.concurrent.atomic.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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.reactivex.rxjava3.subjects.ReplaySubject.ReplayBuffer
compareAndSet, get
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
maxSize
final int maxSize
-
size
int size
-
head
volatile ReplaySubject.Node<java.lang.Object> head
-
tail
ReplaySubject.Node<java.lang.Object> tail
-
done
volatile boolean done
-
-
Method Detail
-
trim
void trim()
-
add
public void add(T value)
- Specified by:
add
in interfaceReplaySubject.ReplayBuffer<T>
-
addFinal
public void addFinal(java.lang.Object notificationLite)
- Specified by:
addFinal
in interfaceReplaySubject.ReplayBuffer<T>
-
trimHead
public void trimHead()
Replace a non-empty head node with an empty one to allow the GC of the inaccessible old value.- Specified by:
trimHead
in interfaceReplaySubject.ReplayBuffer<T>
-
getValue
@Nullable public T getValue()
- Specified by:
getValue
in interfaceReplaySubject.ReplayBuffer<T>
-
getValues
public T[] getValues(T[] array)
- Specified by:
getValues
in interfaceReplaySubject.ReplayBuffer<T>
-
replay
public void replay(ReplaySubject.ReplayDisposable<T> rs)
- Specified by:
replay
in interfaceReplaySubject.ReplayBuffer<T>
-
size
public int size()
- Specified by:
size
in interfaceReplaySubject.ReplayBuffer<T>
-
-