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:
java.io.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
Fields Modifier and Type Field Description (package private) intlimit(package private) longmaxAgeInMillis(package private) Schedulerschedulerprivate static longserialVersionUID-
Fields inherited from class rx.internal.operators.OperatorReplay.BoundedReplayBuffer
index, nl, size, tail
-
-
Constructor Summary
Constructors Constructor Description SizeAndTimeBoundReplayBuffer(int limit, long maxAgeInMillis, Scheduler scheduler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.ObjectenterTransform(java.lang.Object value)Override this to wrap the NotificationLite object into a container to be used later by truncate.(package private) OperatorReplay.NodegetInitialHead()Returns the current head for initializing the replay location for a new subscriber.(package private) java.lang.ObjectleaveTransform(java.lang.Object value)Override this to unwrap the transformed value into a NotificationLite object.(package private) voidtruncate()Override this method to truncate a non-terminated buffer based on its current properties.(package private) voidtruncateFinal()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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
scheduler
final Scheduler scheduler
-
maxAgeInMillis
final long maxAgeInMillis
-
limit
final int limit
-
-
Constructor Detail
-
SizeAndTimeBoundReplayBuffer
public SizeAndTimeBoundReplayBuffer(int limit, long maxAgeInMillis, Scheduler scheduler)
-
-
Method Detail
-
enterTransform
java.lang.Object enterTransform(java.lang.Object value)
Description copied from class:OperatorReplay.BoundedReplayBufferOverride this to wrap the NotificationLite object into a container to be used later by truncate.- Overrides:
enterTransformin classOperatorReplay.BoundedReplayBuffer<T>- Returns:
-
leaveTransform
java.lang.Object leaveTransform(java.lang.Object value)
Description copied from class:OperatorReplay.BoundedReplayBufferOverride this to unwrap the transformed value into a NotificationLite object.- Overrides:
leaveTransformin classOperatorReplay.BoundedReplayBuffer<T>- Returns:
-
getInitialHead
OperatorReplay.Node getInitialHead()
Description copied from class:OperatorReplay.BoundedReplayBufferReturns the current head for initializing the replay location for a new subscriber. Override it to consider linked but outdated elements.- Overrides:
getInitialHeadin classOperatorReplay.BoundedReplayBuffer<T>- Returns:
- the current head
-
truncate
void truncate()
Description copied from class:OperatorReplay.BoundedReplayBufferOverride this method to truncate a non-terminated buffer based on its current properties.- Overrides:
truncatein classOperatorReplay.BoundedReplayBuffer<T>
-
truncateFinal
void truncateFinal()
Description copied from class:OperatorReplay.BoundedReplayBufferOverride this method to truncate a terminated buffer based on its properties (i.e., truncate but the very last node).- Overrides:
truncateFinalin classOperatorReplay.BoundedReplayBuffer<T>
-
-