Package org.fxmisc.flowless
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 -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionPausableSuccessionStream
(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 TypeMethodDescriptionprivate void
handleEvent
(O i) 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 interfaceorg.reactfx.AwaitingEventStream<O>
- See Also:
-
-
Field Details
-
input
-
initial
-
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
-
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 bytimeout
: time gap between two successive events must be at mosttimeout
.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
-
-
Method Details
-
pendingProperty
public javafx.beans.value.ObservableBooleanValue pendingProperty()- Specified by:
pendingProperty
in interfaceorg.reactfx.AwaitingEventStream<O>
- Returns:
- the
pending
property
-
isPending
public boolean isPending()- Specified by:
isPending
in interfaceorg.reactfx.AwaitingEventStream<O>
-
observeInputs
protected final org.reactfx.Subscription observeInputs() -
handleEvent
-
handleTimeout
private void handleTimeout() -
invalidatePending
private void invalidatePending()
-