Class PausableSuccessionStream<O>

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

class PausableSuccessionStream<O> extends org.reactfx.EventStreamBase<O> implements org.reactfx.AwaitingEventStream<O>
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.value.ObservableBooleanValue
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private O
     
    private boolean
     
    private final Function<? super O,? extends O>
     
    private final org.reactfx.EventStream<O>
     
    private javafx.beans.binding.BooleanBinding
     
    private final BiFunction<? super O,? super O,? extends O>
     
    private javafx.beans.property.BooleanProperty
     
    private Predicate<O>
     
    private final org.reactfx.util.Timer
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    PausableSuccessionStream(org.reactfx.EventStream<O> input, Duration timeout, Predicate<O> condition)
     
     
    PausableSuccessionStream(org.reactfx.EventStream<O> input, Duration timeout, javafx.beans.property.BooleanProperty realTime)
    Returns an event stream that, when events are emitted from this stream in close temporal succession, emits only the last event of the succession.
    private
    PausableSuccessionStream(org.reactfx.EventStream<O> input, Duration timeout, javafx.beans.property.BooleanProperty realTime, Predicate<O> condition)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
     
    private void
     
    private void
     
    boolean
     
    protected final org.reactfx.Subscription
     
    javafx.beans.value.ObservableBooleanValue
     

    Methods inherited from class org.reactfx.ObservableBase

    addObserver, enqueueNotifications, equals, forEachObserver, getObserverCount, hashCode, isObservingInputs, newObserver, notifyObservers, notifyObservers, observe, removeObserver, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.reactfx.EventStream

    accumulate, accumulate, accumulate, accumulateBetween, accumulateBetween, accumulateUntilLater, accumulateUntilLater, accumulateUntilLater, accumulateUntilLater, accumulateWhen, accumulateWhen, accumulative, accumulative, cast, conditionOn, conditionOnShowing, distinct, emitBothOnEach, emitOn, emitOnEach, feedTo, feedTo, filter, filter, filterMap, filterMap, flatMap, forgetful, fork, guardedBy, hook, latestN, map, mapToCompletionStage, mapToTask, onRecurseAccumulate, onRecurseAccumulate, onRecurseQueue, onRecurseReduce, onRecurseRetainLatest, or, pausable, pauseWhen, pin, queueBetween, queueUntilLater, queueUntilLater, reduceBetween, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceUntilLater, reduceUntilLater, reduceWhen, reducible, repeatOn, retainLatestBetween, retainLatestUntilLater, retainLatestUntilLater, retainLatestWhen, splitBy, subscribe, subscribeFor, subscribeForOne, successionEnds, successionEnds, supply, supply, supplyCompletionStage, supplyTask, suppressible, suppressWhen, suspenderOf, thenAccumulateFor, thenAccumulateFor, thenAccumulateFor, thenAccumulateFor, thenIgnoreFor, thenIgnoreFor, thenReduceFor, thenReduceFor, thenRetainLatestFor, thenRetainLatestFor, threadBridge, threadBridgeFromFx, threadBridgeToFx, toBinding, withDefaultEvent

    Methods inherited from interface org.reactfx.Observable

    addObserver, observe, removeObserver

    Methods inherited from interface org.reactfx.ProperEventStream

    defaultNotificationAccumulator, emit

    Methods inherited from interface org.reactfx.ProperObservable

    defaultEquals, defaultHashCode, defaultToString, notifyObservers
  • Property Details

    • pending

      public javafx.beans.value.ObservableBooleanValue pendingProperty
      Specified by:
      pendingProperty in interface org.reactfx.AwaitingEventStream<O>
      See Also:
  • Field Details

    • input

      private final org.reactfx.EventStream<O> input
    • initial

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

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

      private final org.reactfx.util.Timer timer
    • hasEvent

      private boolean hasEvent
    • pending

      private javafx.beans.binding.BooleanBinding pending
    • successionOff

      private javafx.beans.property.BooleanProperty successionOff
    • successionOffCond

      private Predicate<O> successionOffCond
    • event

      private O event
  • Constructor Details

    • PausableSuccessionStream

      public PausableSuccessionStream(org.reactfx.EventStream<O> input, Duration timeout, javafx.beans.property.BooleanProperty realTime)
      Returns an event stream that, when events are emitted from this stream in close temporal succession, emits only the last event of the succession. What is considered a close temporal succession is defined by timeout: time gap between two successive events must be at most timeout.

      Note: This function can be used only when this stream and the returned stream are used from the JavaFX application thread.

      Parameters:
      timeout - the maximum time difference between two subsequent events in close succession.
      realTime - when true immediately emits the next event and sets realTime back to false.
    • PausableSuccessionStream

      public PausableSuccessionStream(org.reactfx.EventStream<O> input, Duration timeout, Predicate<O> condition)
      Parameters:
      timeout - the maximum time difference between two subsequent events in close succession.
      condition - when true immediately emits the event, otherwise waits for timeout before emitting the last received event.
    • PausableSuccessionStream

      private PausableSuccessionStream(org.reactfx.EventStream<O> input, Duration timeout, javafx.beans.property.BooleanProperty realTime, Predicate<O> condition)
  • Method Details

    • pendingProperty

      public javafx.beans.value.ObservableBooleanValue pendingProperty()
      Specified by:
      pendingProperty in interface org.reactfx.AwaitingEventStream<O>
      Returns:
      the pending property
    • isPending

      public boolean isPending()
      Specified by:
      isPending in interface org.reactfx.AwaitingEventStream<O>
    • observeInputs

      protected final org.reactfx.Subscription observeInputs()
      Specified by:
      observeInputs in class org.reactfx.ObservableBase<Consumer<? super O>,O>
    • handleEvent

      private void handleEvent(O i)
    • handleTimeout

      private void handleTimeout()
    • invalidatePending

      private void invalidatePending()