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 java.lang.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 Classes Modifier and Type Class Description (package private) static classOperatorWindowWithTime.CountedSerializedSubject<T>Record to store the subject and the emission count.(package private) classOperatorWindowWithTime.ExactSubscriberSubscriber with exact, non-overlapping windows.(package private) classOperatorWindowWithTime.InexactSubscriberSubscriber with inexact, potentially overlapping or discontinuous windows.(package private) static classOperatorWindowWithTime.State<T>The immutable windowing state with one subject.
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.ObjectNEXT_SUBJECTIndicate the current subject should complete and a new subject be emitted.(package private) static NotificationLite<java.lang.Object>NLFor error and completion indication.(package private) Schedulerscheduler(package private) intsize(package private) longtimeshiftPeriod of creating new windows.(package private) longtimespanLength of each window.(package private) java.util.concurrent.TimeUnitunit
-
Constructor Summary
Constructors Constructor Description OperatorWindowWithTime(long timespan, long timeshift, java.util.concurrent.TimeUnit unit, int size, Scheduler scheduler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscriber<? super T>call(Subscriber<? super Observable<T>> child)
-
-
-
Field Detail
-
timespan
final long timespan
Length of each window.
-
timeshift
final long timeshift
Period of creating new windows.
-
unit
final java.util.concurrent.TimeUnit unit
-
scheduler
final Scheduler scheduler
-
size
final int size
-
NEXT_SUBJECT
static final java.lang.Object NEXT_SUBJECT
Indicate the current subject should complete and a new subject be emitted.
-
NL
static final NotificationLite<java.lang.Object> NL
For error and completion indication.
-
-
Constructor Detail
-
OperatorWindowWithTime
public OperatorWindowWithTime(long timespan, long timeshift, java.util.concurrent.TimeUnit unit, int size, Scheduler scheduler)
-
-
Method Detail
-
call
public Subscriber<? super T> call(Subscriber<? super Observable<T>> child)
- Specified by:
callin interfaceFunc1<Subscriber<? super Observable<T>>,Subscriber<? super T>>
-
-