Class 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.

    • 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
      • 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)