Package org.reactfx
Class SuccessionReducingStream<I,O>
- java.lang.Object
-
- org.reactfx.ObservableBase<java.util.function.Consumer<? super T>,T>
-
- org.reactfx.EventStreamBase<O>
-
- org.reactfx.SuccessionReducingStream<I,O>
-
- All Implemented Interfaces:
AwaitingEventStream<O>
,EventStream<O>
,Observable<java.util.function.Consumer<? super O>>
,ProperEventStream<O>
,ProperObservable<java.util.function.Consumer<? super O>,O>
class SuccessionReducingStream<I,O> extends EventStreamBase<O> implements AwaitingEventStream<O>
-
-
Field Summary
Fields Modifier and Type Field Description private O
event
private boolean
hasEvent
private java.util.function.Function<? super I,? extends O>
initial
private EventStream<I>
input
private javafx.beans.binding.BooleanBinding
pending
private java.util.function.BiFunction<? super O,? super I,? extends O>
reduction
private Timer
timer
-
Constructor Summary
Constructors Constructor Description SuccessionReducingStream(EventStream<I> input, java.util.function.Function<? super I,? extends O> initial, java.util.function.BiFunction<? super O,? super I,? extends O> reduction, java.util.function.Function<java.lang.Runnable,Timer> timerFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
handleEvent(I i)
private void
handleTimeout()
private void
invalidatePending()
boolean
isPending()
protected Subscription
observeInputs()
Starts observing this observable's input(s), if any.javafx.beans.value.ObservableBooleanValue
pendingProperty()
Indicates whether there is a pending event that will be emitted by this stream in the (near) future.-
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
-
-
-
-
Field Detail
-
input
private final EventStream<I> input
-
timer
private final Timer timer
-
hasEvent
private boolean hasEvent
-
pending
private javafx.beans.binding.BooleanBinding pending
-
event
private O event
-
-
Method Detail
-
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 interfaceAwaitingEventStream<I>
-
isPending
public boolean isPending()
- Specified by:
isPending
in interfaceAwaitingEventStream<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 beforeObservableBase.newObserver(Object)
is called for the first observer.- Specified by:
observeInputs
in classObservableBase<java.util.function.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()
-
-