Package org.reactfx

Class SuccessionReducingStream<I,O>

java.lang.Object
org.reactfx.ObservableBase<Consumer<? super O>,O>
org.reactfx.EventStreamBase<O>
org.reactfx.SuccessionReducingStream<I,O>
All Implemented Interfaces:
AwaitingEventStream<O>, EventStream<O>, Observable<Consumer<? super O>>, ProperEventStream<O>, ProperObservable<Consumer<? super O>,O>

class SuccessionReducingStream<I,O> extends EventStreamBase<O> implements AwaitingEventStream<O>
  • Property Details

  • Field Details

    • input

      private final EventStream<I> input
    • initial

      private final Function<? super I,? extends O> initial
    • reduction

      private final BiFunction<? super O,? super I,? extends O> reduction
    • timer

      private final Timer timer
    • hasEvent

      private boolean hasEvent
    • pending

      private javafx.beans.binding.BooleanBinding pending
    • event

      private O event
  • Constructor Details

  • Method Details

    • pendingProperty

      public javafx.beans.value.ObservableBooleanValue pendingProperty()
      Description copied from interface: AwaitingEventStream
      Indicates whether there is a pending event that will be emitted by this stream in the (near) future. This may mean that an event has occurred that causes this stream to emit an event with some delay, e.g. waiting for a timer or completion of an asynchronous task.
      Specified by:
      pendingProperty in interface AwaitingEventStream<I>
      Returns:
      the pending property
    • isPending

      public boolean isPending()
      Specified by:
      isPending in interface AwaitingEventStream<I>
    • observeInputs

      protected final 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 O>,O>
      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.
    • handleEvent

      private void handleEvent(I i)
    • handleTimeout

      private void handleTimeout()
    • invalidatePending

      private void invalidatePending()