Class FlowableReplay.UnboundedReplayBuffer<T>
java.lang.Object
java.util.AbstractCollection<Object>
java.util.AbstractList<Object>
java.util.ArrayList<Object>
io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay.UnboundedReplayBuffer<T>
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
FlowableReplay.ReplayBuffer<T>
,Serializable
,Cloneable
,Iterable<Object>
,Collection<Object>
,List<Object>
,RandomAccess
,SequencedCollection<Object>
- Enclosing class:
FlowableReplay<T>
static final class FlowableReplay.UnboundedReplayBuffer<T>
extends ArrayList<Object>
implements FlowableReplay.ReplayBuffer<T>
Holds an unbounded list of events.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
(package private) int
The total number of events in the buffer.Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
complete()
Adds a completion event to the buffer.void
Adds a terminal exception to the buffer.void
Adds a regular value to the buffer.void
replay
(FlowableReplay.InnerSubscription<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, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
size
volatile int sizeThe total number of events in the buffer.
-
-
Constructor Details
-
UnboundedReplayBuffer
UnboundedReplayBuffer(int capacityHint)
-
-
Method Details
-
next
Description copied from interface:FlowableReplay.ReplayBuffer
Adds a regular value to the buffer.- Specified by:
next
in interfaceFlowableReplay.ReplayBuffer<T>
- Parameters:
value
- the next value to store
-
error
Description copied from interface:FlowableReplay.ReplayBuffer
Adds a terminal exception to the buffer.- Specified by:
error
in interfaceFlowableReplay.ReplayBuffer<T>
- Parameters:
e
- the Throwable instance
-
complete
public void complete()Description copied from interface:FlowableReplay.ReplayBuffer
Adds a completion event to the buffer.- Specified by:
complete
in interfaceFlowableReplay.ReplayBuffer<T>
-
replay
Description copied from interface:FlowableReplay.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 interfaceFlowableReplay.ReplayBuffer<T>
- Parameters:
output
- the receiver of the events
-