Package rx.internal.operators
Class OperatorWindowWithTime<T>
java.lang.Object
rx.internal.operators.OperatorWindowWithTime<T>
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
Func1<Subscriber<? super Observable<T>>,
,Subscriber<? super T>> Function
,Observable.Operator<Observable<T>,
T>
public final class OperatorWindowWithTime<T>
extends Object
implements Observable.Operator<Observable<T>,T>
Creates windows of values into the source sequence with timed window creation, length and size bounds.
If timespan == timeshift, windows are non-overlapping but always continuous, i.e., when the size bound is reached, a new
window is opened.
Note that this conforms the Rx.NET behavior, but does not match former RxJava behavior, which operated as a regular buffer and mapped its lists to Observables.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
Record to store the subject and the emission count.(package private) final class
Subscriber with exact, non-overlapping windows.(package private) final class
Subscriber with inexact, potentially overlapping or discontinuous windows.(package private) static final class
The immutable windowing state with one subject. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Object
Indicate the current subject should complete and a new subject be emitted.(package private) static final NotificationLite
<Object> For error and completion indication.(package private) final Scheduler
(package private) final int
(package private) final long
Period of creating new windows.(package private) final long
Length of each window.(package private) final TimeUnit
-
Constructor Summary
ConstructorsConstructorDescriptionOperatorWindowWithTime
(long timespan, long timeshift, TimeUnit unit, int size, Scheduler scheduler) -
Method Summary
Modifier and TypeMethodDescriptionSubscriber
<? super T> call
(Subscriber<? super Observable<T>> child)
-
Field Details
-
timespan
final long timespanLength of each window. -
timeshift
final long timeshiftPeriod of creating new windows. -
unit
-
scheduler
-
size
final int size -
NEXT_SUBJECT
Indicate the current subject should complete and a new subject be emitted. -
NL
For error and completion indication.
-
-
Constructor Details
-
OperatorWindowWithTime
-
-
Method Details
-
call
- Specified by:
call
in interfaceFunc1<Subscriber<? super Observable<T>>,
Subscriber<? super T>>
-