Package rx.internal.operators
Class OperatorReplay.UnboundedReplayBuffer<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<java.lang.Object>
-
- rx.internal.operators.OperatorReplay.UnboundedReplayBuffer<T>
-
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<java.lang.Object>
,java.util.Collection<java.lang.Object>
,java.util.List<java.lang.Object>
,java.util.RandomAccess
,OperatorReplay.ReplayBuffer<T>
- Enclosing class:
- OperatorReplay<T>
static final class OperatorReplay.UnboundedReplayBuffer<T> extends java.util.ArrayList<java.lang.Object> implements OperatorReplay.ReplayBuffer<T>
Holds an unbounded list of events.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) NotificationLite<T>
nl
private static long
serialVersionUID
(package private) int
size
The total number of events in the buffer.
-
Constructor Summary
Constructors Constructor Description UnboundedReplayBuffer(int capacityHint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete()
Adds a completion event to the buffervoid
error(java.lang.Throwable e)
Adds a terminal exception to the buffervoid
next(T value)
Adds a regular value to the buffer.void
replay(OperatorReplay.InnerProducer<T> output)
Tries to replay the buffered values to the subscriber inside the output if there is new value and requests available at the same time.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
nl
final NotificationLite<T> nl
-
size
volatile int size
The total number of events in the buffer.
-
-
Method Detail
-
next
public void next(T value)
Description copied from interface:OperatorReplay.ReplayBuffer
Adds a regular value to the buffer.- Specified by:
next
in interfaceOperatorReplay.ReplayBuffer<T>
-
error
public void error(java.lang.Throwable e)
Description copied from interface:OperatorReplay.ReplayBuffer
Adds a terminal exception to the buffer- Specified by:
error
in interfaceOperatorReplay.ReplayBuffer<T>
-
complete
public void complete()
Description copied from interface:OperatorReplay.ReplayBuffer
Adds a completion event to the buffer- Specified by:
complete
in interfaceOperatorReplay.ReplayBuffer<T>
-
replay
public void replay(OperatorReplay.InnerProducer<T> output)
Description copied from interface:OperatorReplay.ReplayBuffer
Tries to replay the buffered values to the subscriber inside the output if there is new value and requests available at the same time.- Specified by:
replay
in interfaceOperatorReplay.ReplayBuffer<T>
-
-