Package org.reactfx

Class LatestNStream<T>

All Implemented Interfaces:
EventStream<List<T>>, Observable<Consumer<? super List<T>>>, ProperEventStream<List<T>>, ProperObservable<Consumer<? super List<T>>,List<T>>

class LatestNStream<T> extends EventStreamBase<List<T>>
  • Field Details

    • source

      private final EventStream<T> source
    • n

      private final int n
    • first

      private List<T> first
    • second

      private List<T> second
    • concatView

      private List<T> concatView
  • Constructor Details

    • LatestNStream

      public LatestNStream(EventStream<T> source, int n)
  • Method Details

    • observeInputs

      protected Subscription observeInputs()
      Description copied from class: ObservableBase
      Starts observing this observable's input(s), if any. This method is called when the number of observers goes from 0 to 1. This method is called before ObservableBase.newObserver(Object) is called for the first observer.
      Specified by:
      observeInputs in class ObservableBase<Consumer<? super List<T>>,List<T>>
      Returns:
      subscription used to stop observing inputs. The subscription is unsubscribed (i.e. input observation stops) when the number of observers goes down to 0.
    • onEvent

      private void onEvent(T event)