Package rx.internal.operators
Class OperatorReplay.SizeAndTimeBoundReplayBuffer<T>
java.lang.Object
java.util.concurrent.atomic.AtomicReference<OperatorReplay.Node>
rx.internal.operators.OperatorReplay.BoundedReplayBuffer<T>
rx.internal.operators.OperatorReplay.SizeAndTimeBoundReplayBuffer<T>
- Type Parameters:
T
- the buffered value type
- All Implemented Interfaces:
Serializable
,OperatorReplay.ReplayBuffer<T>
- Enclosing class:
OperatorReplay<T>
static final class OperatorReplay.SizeAndTimeBoundReplayBuffer<T>
extends OperatorReplay.BoundedReplayBuffer<T>
Size and time bound replay buffer.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int
(package private) final long
(package private) final Scheduler
private static final long
Fields inherited from class rx.internal.operators.OperatorReplay.BoundedReplayBuffer
index, nl, size, tail
-
Constructor Summary
ConstructorsConstructorDescriptionSizeAndTimeBoundReplayBuffer
(int limit, long maxAgeInMillis, Scheduler scheduler) -
Method Summary
Modifier and TypeMethodDescription(package private) Object
enterTransform
(Object value) Override this to wrap the NotificationLite object into a container to be used later by truncate.(package private) OperatorReplay.Node
Returns the current head for initializing the replay location for a new subscriber.(package private) Object
leaveTransform
(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
Override this method to truncate a terminated buffer based on its properties (i.e., truncate but the very last node).Methods inherited from class rx.internal.operators.OperatorReplay.BoundedReplayBuffer
addLast, collect, complete, error, hasCompleted, hasError, next, removeFirst, removeSome, replay, setFirst
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 Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
scheduler
-
maxAgeInMillis
final long maxAgeInMillis -
limit
final int limit
-
-
Constructor Details
-
SizeAndTimeBoundReplayBuffer
-
-
Method Details
-
enterTransform
Description copied from class:OperatorReplay.BoundedReplayBuffer
Override this to wrap the NotificationLite object into a container to be used later by truncate.- Overrides:
enterTransform
in classOperatorReplay.BoundedReplayBuffer<T>
- Parameters:
value
-- Returns:
-
leaveTransform
Description copied from class:OperatorReplay.BoundedReplayBuffer
Override this to unwrap the transformed value into a NotificationLite object.- Overrides:
leaveTransform
in classOperatorReplay.BoundedReplayBuffer<T>
- Parameters:
value
-- Returns:
-
getInitialHead
OperatorReplay.Node getInitialHead()Description copied from class:OperatorReplay.BoundedReplayBuffer
Returns the current head for initializing the replay location for a new subscriber. Override it to consider linked but outdated elements.- Overrides:
getInitialHead
in classOperatorReplay.BoundedReplayBuffer<T>
- Returns:
- the current head
-
truncate
void truncate()Description copied from class:OperatorReplay.BoundedReplayBuffer
Override this method to truncate a non-terminated buffer based on its current properties.- Overrides:
truncate
in classOperatorReplay.BoundedReplayBuffer<T>
-
truncateFinal
void truncateFinal()Description copied from class:OperatorReplay.BoundedReplayBuffer
Override this method to truncate a terminated buffer based on its properties (i.e., truncate but the very last node).- Overrides:
truncateFinal
in classOperatorReplay.BoundedReplayBuffer<T>
-