Class FlowableReplay.SizeAndTimeBoundReplayBuffer<T>
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicReference<FlowableReplay.Node>
-
- io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay.BoundedReplayBuffer<T>
-
- io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay.SizeAndTimeBoundReplayBuffer<T>
-
- Type Parameters:
T
- the buffered value type
- All Implemented Interfaces:
FlowableReplay.ReplayBuffer<T>
,java.io.Serializable
- Enclosing class:
- FlowableReplay<T>
static final class FlowableReplay.SizeAndTimeBoundReplayBuffer<T> extends FlowableReplay.BoundedReplayBuffer<T>
Size and time bound replay buffer.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
limit
(package private) long
maxAge
(package private) Scheduler
scheduler
private static long
serialVersionUID
(package private) java.util.concurrent.TimeUnit
unit
-
Fields inherited from class io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay.BoundedReplayBuffer
eagerTruncate, index, size, tail
-
-
Constructor Summary
Constructors Constructor Description SizeAndTimeBoundReplayBuffer(int limit, long maxAge, java.util.concurrent.TimeUnit unit, Scheduler scheduler, boolean eagerTruncate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.Object
enterTransform(java.lang.Object value, boolean terminal)
Override this to wrap the NotificationLite object into a container to be used later by truncate.(package private) FlowableReplay.Node
getHead()
(package private) java.lang.Object
leaveTransform(java.lang.Object value)
Override this to unwrap the transformed value into a NotificationLite object.(package private) void
truncate()
Override this method to truncate a non-terminated buffer based on its current properties.(package private) void
truncateFinal()
Override this method to truncate a terminated buffer based on its properties (i.e., truncate but the very last node).-
Methods inherited from class io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay.BoundedReplayBuffer
addLast, collect, complete, error, hasCompleted, hasError, next, removeFirst, removeSome, replay, setFirst, trimHead
-
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
scheduler
final Scheduler scheduler
-
maxAge
final long maxAge
-
unit
final java.util.concurrent.TimeUnit unit
-
limit
final int limit
-
-
Constructor Detail
-
SizeAndTimeBoundReplayBuffer
SizeAndTimeBoundReplayBuffer(int limit, long maxAge, java.util.concurrent.TimeUnit unit, Scheduler scheduler, boolean eagerTruncate)
-
-
Method Detail
-
enterTransform
java.lang.Object enterTransform(java.lang.Object value, boolean terminal)
Description copied from class:FlowableReplay.BoundedReplayBuffer
Override this to wrap the NotificationLite object into a container to be used later by truncate.- Overrides:
enterTransform
in classFlowableReplay.BoundedReplayBuffer<T>
- Parameters:
value
- the value to transform into the internal representationterminal
- is this a terminal value?- Returns:
- the transformed value
-
leaveTransform
java.lang.Object leaveTransform(java.lang.Object value)
Description copied from class:FlowableReplay.BoundedReplayBuffer
Override this to unwrap the transformed value into a NotificationLite object.- Overrides:
leaveTransform
in classFlowableReplay.BoundedReplayBuffer<T>
- Parameters:
value
- the input value to transform to the external representation- Returns:
- the transformed value
-
truncate
void truncate()
Description copied from class:FlowableReplay.BoundedReplayBuffer
Override this method to truncate a non-terminated buffer based on its current properties.- Specified by:
truncate
in classFlowableReplay.BoundedReplayBuffer<T>
-
truncateFinal
void truncateFinal()
Description copied from class:FlowableReplay.BoundedReplayBuffer
Override this method to truncate a terminated buffer based on its properties (i.e., truncate but the very last node).- Overrides:
truncateFinal
in classFlowableReplay.BoundedReplayBuffer<T>
-
getHead
FlowableReplay.Node getHead()
- Overrides:
getHead
in classFlowableReplay.BoundedReplayBuffer<T>
-
-