Package rx.internal.operators
Class OperatorBufferWithSize<T>
- java.lang.Object
-
- rx.internal.operators.OperatorBufferWithSize<T>
-
- Type Parameters:
T
- the buffered value type
- All Implemented Interfaces:
Func1<Subscriber<? super java.util.List<T>>,Subscriber<? super T>>
,Function
,Observable.Operator<java.util.List<T>,T>
public final class OperatorBufferWithSize<T> extends java.lang.Object implements Observable.Operator<java.util.List<T>,T>
This operation takes values from the specifiedObservable
source and stores them in all active chunks until the buffer contains a specified number of elements. The buffer is then emitted. Chunks are created after a certain amount of values have been received. When the sourceObservable
completes or produces an error, the currently active chunks are emitted, and the event is propagated to all subscribedSubscriber
s.Note that this operation can produce non-connected, connected non-overlapping, or overlapping chunks depending on the input parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
OperatorBufferWithSize.BufferExact<T>
(package private) static class
OperatorBufferWithSize.BufferOverlap<T>
(package private) static class
OperatorBufferWithSize.BufferSkip<T>
-
Constructor Summary
Constructors Constructor Description OperatorBufferWithSize(int count, int skip)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscriber<? super T>
call(Subscriber<? super java.util.List<T>> child)
-
-
-
Constructor Detail
-
OperatorBufferWithSize
public OperatorBufferWithSize(int count, int skip)
- Parameters:
count
- the number of elements a buffer should have before being emittedskip
- the interval with which chunks have to be created. Note that whenskip == count
the operator will produce non-overlapping chunks. Ifskip < count
, this buffer operation will produce overlapping chunks and ifskip > count
non-overlapping chunks will be created and some values will not be pushed into a buffer at all!
-
-
Method Detail
-
call
public Subscriber<? super T> call(Subscriber<? super java.util.List<T>> child)
- Specified by:
call
in interfaceFunc1<Subscriber<? super java.util.List<T>>,Subscriber<? super T>>
-
-