Top Inners Fields Constructors Methods
org.reactfx

public Class EventStreams

extends Object
Class Inheritance
Static Imports
org.reactfx.util.Tuples.*

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final EventStream<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static EventStream<Long>
animationFrames()

Returns a stream that, on each animation frame, emits the duration elapsed since the previous animation frame, in nanoseconds.

public static EventStream<Long>
animationTicks()

Returns an event stream that emits a timestamp of the current frame in nanoseconds on every frame.

public static <T> EventStream<Change<T>>
changesOf(ObservableValue<T> observable)

public static <T> EventStream<ListChangeListener.Change<? extends T>>
public static <T> EventStream<SetChangeListener.Change<? extends T>>
public static <K, V> EventStream<MapChangeListener.Change<? extends K, ? extends V>>
public static <A, B> EventStream<Tuple2<A, B>>
combine(EventStream<A> srcA, EventStream<B> srcB)

public static <A, B, C> EventStream<Tuple3<A, B, C>>
combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC)

public static <A, B, C, D> EventStream<Tuple4<A, B, C, D>>
combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC, EventStream<D> srcD)

public static <A, B, C, D, E> EventStream<Tuple5<A, B, C, D, E>>
combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC, EventStream<D> srcD, EventStream<E> srcE)

public static <A, B, C, D, E, F> EventStream<Tuple6<A, B, C, D, E, F>>
combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC, EventStream<D> srcD, EventStream<E> srcE, EventStream<F> srcF)

private static <T> EventStream<T>
create(Supplier<? extends T> computeValue, Observable... dependencies)

public static <T extends Event> EventStream<T>
eventsOf(Node node, EventType<T> eventType)

public static <T extends Event> EventStream<T>
eventsOf(Scene scene, EventType<T> eventType)

public static <T extends Event> EventStream<T>
eventsOf(MenuItem menuItem, EventType<T> eventType)

public static <T extends Event> EventStream<T>
eventsOf(Window window, EventType<T> eventType)

public static <L, R> Tuple2<EventStream<L>, EventStream<R>>
fork(EventStream<? extends Either<L, R>> stream)

public static EventStream<Void>
invalidationsOf(Observable observable)

Creates an event stream that emits an impulse on every invalidation of the given observable.

public static <T> EventStream<T>
merge(EventStream<? extends T>... inputs)

Returns an event stream that emits all the events emitted from any of the inputs.

public static <T> EventStream<T>
merge(ObservableSet<? extends EventStream<T>> set)

Returns an event stream that emits all the events emitted from any of the event streams in the given observable set.

public static <T, U> EventStream<U>
merge(ObservableSet<? extends T>
observable set of elements
set
,
Function<? super T, ? extends EventStream<U>>
function to obtain an event stream from an element
f
)

A more general version of merge(ObservableSet) for a set of arbitrary element type and a function to obtain an event stream from the element.

public static <T> EventStream<T>
never()

Returns an event stream that never emits any value.

public static <T> EventStream<T>
public static <O extends Observable> EventStream<O>
repeatOnInvalidation(O observable)

Creates an event stream that emits the given observable immediately for every subscriber and re-emits it on every subsequent invalidation of the observable.

public static EventStream<?>
restartableTicks(Duration
- the amount of time that passes until this stream emits its next tick
interval
,
EventStream<?>
- the EventStream that resets this EventStream's internal timer
impulse
)

Returns a ticks(Duration) EventStream whose timer restarts whenever impulse emits an event.

public static EventStream<?>
restartableTicks0(Duration
- the amount of time that passes until this stream emits its next tick
interval
,
EventStream<?>
- the EventStream that resets this EventStream's internal timer
impulse
)

Returns a ticks0(Duration) EventStream whose timer restarts whenever impulse emits an event.

public static <T> EventStream<ListModification<? extends T>>
simpleChangesOf(ObservableList<T> list)

Use only when the subscriber does not cause list modification of the underlying list.

public static <C extends Collection<?> & Observable> EventStream<Integer>
sizeOf(C collection)

public static EventStream<Integer>
sizeOf(ObservableMap<?, ?> map)

public static EventStream<?>
ticks(Duration interval)

Returns an event stream that emits periodic ticks.

public static EventStream<?>
ticks(Duration interval, ScheduledExecutorService
scheduler used to schedule periodic emissions.
scheduler
,
Executor
single-thread executor used to emit the ticks.
eventThreadExecutor
)

Returns an event stream that emits periodic ticks on the given eventThreadExecutor.

public static EventStream<?>
ticks0(Duration interval)

Returns an event stream that emits periodic ticks.

public static <T> EventStream<T>
valuesOf(ObservableValue<T> observable)

Creates an event stream that emits the value of the given ObservableValue immediately for every subscriber and then on every change.

public static <A, B> EventStream<Tuple2<A, B>>
zip(EventStream<A> srcA, EventStream<B> srcB)

public static <A, B, C> EventStream<Tuple3<A, B, C>>
zip(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NEVERback to summary
private static final EventStream<?> NEVER

Constructor Detail

EventStreamsback to summary
public EventStreams()

Method Detail

animationFramesback to summary
public static EventStream<Long> animationFrames()

Returns a stream that, on each animation frame, emits the duration elapsed since the previous animation frame, in nanoseconds.

animationTicksback to summary
public static EventStream<Long> animationTicks()

Returns an event stream that emits a timestamp of the current frame in nanoseconds on every frame. The timestamp has the same meaning as the argument of the AnimationTimer#handle(long) method.

changesOfback to summary
public static <T> EventStream<Change<T>> changesOf(ObservableValue<T> observable)
changesOfback to summary
public static <T> EventStream<ListChangeListener.Change<? extends T>> changesOf(ObservableList<T> list)
See Also
LiveList#changesOf(ObservableList)
changesOfback to summary
public static <T> EventStream<SetChangeListener.Change<? extends T>> changesOf(ObservableSet<T> set)
changesOfback to summary
public static <K, V> EventStream<MapChangeListener.Change<? extends K, ? extends V>> changesOf(ObservableMap<K, V> map)
combineback to summary
public static <A, B> EventStream<Tuple2<A, B>> combine(EventStream<A> srcA, EventStream<B> srcB)
combineback to summary
public static <A, B, C> EventStream<Tuple3<A, B, C>> combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC)
combineback to summary
public static <A, B, C, D> EventStream<Tuple4<A, B, C, D>> combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC, EventStream<D> srcD)
combineback to summary
public static <A, B, C, D, E> EventStream<Tuple5<A, B, C, D, E>> combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC, EventStream<D> srcD, EventStream<E> srcE)
combineback to summary
public static <A, B, C, D, E, F> EventStream<Tuple6<A, B, C, D, E, F>> combine(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC, EventStream<D> srcD, EventStream<E> srcE, EventStream<F> srcF)
createback to summary
private static <T> EventStream<T> create(Supplier<? extends T> computeValue, Observable... dependencies)
eventsOfback to summary
public static <T extends Event> EventStream<T> eventsOf(Node node, EventType<T> eventType)
eventsOfback to summary
public static <T extends Event> EventStream<T> eventsOf(Scene scene, EventType<T> eventType)
eventsOfback to summary
public static <T extends Event> EventStream<T> eventsOf(MenuItem menuItem, EventType<T> eventType)
eventsOfback to summary
public static <T extends Event> EventStream<T> eventsOf(Window window, EventType<T> eventType)
forkback to summary
public static <L, R> Tuple2<EventStream<L>, EventStream<R>> fork(EventStream<? extends Either<L, R>> stream)
invalidationsOfback to summary
public static EventStream<Void> invalidationsOf(Observable observable)

Creates an event stream that emits an impulse on every invalidation of the given observable.

mergeback to summary
public static <T> EventStream<T> merge(EventStream<? extends T>... inputs)

Returns an event stream that emits all the events emitted from any of the inputs. The event type of the returned stream is the nearest common super-type of all the inputs.

Annotations
@SafeVarargs
See Also
EventStream#or(EventStream)
mergeback to summary
public static <T> EventStream<T> merge(ObservableSet<? extends EventStream<T>> set)

Returns an event stream that emits all the events emitted from any of the event streams in the given observable set. When an event stream is added to the set, the returned stream will start emitting its events. When an event stream is removed from the set, its events will no longer be emitted from the returned stream.

mergeback to summary
public static <T, U> EventStream<U> merge(ObservableSet<? extends T> set, Function<? super T, ? extends EventStream<U>> f)

A more general version of merge(ObservableSet) for a set of arbitrary element type and a function to obtain an event stream from the element.

Parameters
set:ObservableSet<? extends T>

observable set of elements

f:Function<? super T, ? extends EventStream<U>>

function to obtain an event stream from an element

neverback to summary
public static <T> EventStream<T> never()

Returns an event stream that never emits any value.

Annotations
@SuppressWarnings:unchecked
nonNullValuesOfback to summary
public static <T> EventStream<T> nonNullValuesOf(ObservableValue<T> observable)
repeatOnInvalidationback to summary
public static <O extends Observable> EventStream<O> repeatOnInvalidation(O observable)

Creates an event stream that emits the given observable immediately for every subscriber and re-emits it on every subsequent invalidation of the observable.

restartableTicksback to summary
public static EventStream<?> restartableTicks(Duration interval, EventStream<?> impulse)

Returns a ticks(Duration) EventStream whose timer restarts whenever impulse emits an event.

Parameters
interval:Duration

- the amount of time that passes until this stream emits its next tick

impulse:EventStream<?>

- the EventStream that resets this EventStream's internal timer

restartableTicks0back to summary
public static EventStream<?> restartableTicks0(Duration interval, EventStream<?> impulse)

Returns a ticks0(Duration) EventStream whose timer restarts whenever impulse emits an event.

Note

since ticks0(Duration) is used, restarting the timer will make the returned EventStream immediately emit a new tick.

Parameters
interval:Duration

- the amount of time that passes until this stream emits its next tick

impulse:EventStream<?>

- the EventStream that resets this EventStream's internal timer

simpleChangesOfback to summary
public static <T> EventStream<ListModification<? extends T>> simpleChangesOf(ObservableList<T> list)

Use only when the subscriber does not cause list modification of the underlying list.

sizeOfback to summary
public static <C extends Collection<?> & Observable> EventStream<Integer> sizeOf(C collection)
sizeOfback to summary
public static EventStream<Integer> sizeOf(ObservableMap<?, ?> map)
ticksback to summary
public static EventStream<?> ticks(Duration interval)

Returns an event stream that emits periodic ticks. The first tick is emitted after interval amount of time has passed. The returned stream may only be used on the JavaFX application thread.

As with all lazily bound streams, ticks are emitted only when there is at least one subscriber to the returned stream. This means that to release associated resources, it suffices to unsubscribe from the returned stream.

ticksback to summary
public static EventStream<?> ticks(Duration interval, ScheduledExecutorService scheduler, Executor eventThreadExecutor)

Returns an event stream that emits periodic ticks on the given eventThreadExecutor. The returned stream may only be used from that executor's thread.

As with all lazily bound streams, ticks are emitted only when there is at least one subscriber to the returned stream. This means that to release associated resources, it suffices to unsubscribe from the returned stream.

Parameters
scheduler:ScheduledExecutorService

scheduler used to schedule periodic emissions.

eventThreadExecutor:Executor

single-thread executor used to emit the ticks.

ticks0back to summary
public static EventStream<?> ticks0(Duration interval)

Returns an event stream that emits periodic ticks. The first tick is emitted at time 0. The returned stream may only be used on the JavaFX application thread.

As with all lazily bound streams, ticks are emitted only when there is at least one subscriber to the returned stream. This means that to release associated resources, it suffices to unsubscribe from the returned stream.

valuesOfback to summary
public static <T> EventStream<T> valuesOf(ObservableValue<T> observable)

Creates an event stream that emits the value of the given ObservableValue immediately for every subscriber and then on every change.

zipback to summary
public static <A, B> EventStream<Tuple2<A, B>> zip(EventStream<A> srcA, EventStream<B> srcB)
zipback to summary
public static <A, B, C> EventStream<Tuple3<A, B, C>> zip(EventStream<A> srcA, EventStream<B> srcB, EventStream<C> srcC)
org.reactfx back to summary

private Class EventStreams.ExclusivePocket<T>

extends EventStreams.Pocket<T>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final void
Inherited from org.reactfx.EventStreams.Pocket:
cleargetgetAndClearhasValue

Constructor Detail

ExclusivePocketback to summary
private ExclusivePocket()

Method Detail

setback to summary
public final void set(T a)

Overrides org.reactfx.EventStreams.Pocket.set.

Annotations
@Override
org.reactfx back to summary

private final Class EventStreams.Never<T>

extends RigidObservable<Consumer<? super T>>
implements EventStream<T>
Class Inheritance
All Implemented Interfaces
org.reactfx.EventStream, org.reactfx.Observable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from org.reactfx.RigidObservable:
addObserverobserveremoveObserver

Constructor Detail

Neverback to summary
private Never()
org.reactfx back to summary

private Class EventStreams.Pocket<T>

extends Object
Class Inheritance
Known Direct Subclasses
org.reactfx.EventStreams.ExclusivePocket

Field Summary

Modifier and TypeField and Description
private boolean
private T

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public T
get()

public T
public boolean
public void
set(T value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hasValueback to summary
private boolean hasValue
valueback to summary
private T value

Constructor Detail

Pocketback to summary
private Pocket()

Method Detail

clearback to summary
public void clear()
getback to summary
public T get()
getAndClearback to summary
public T getAndClear()
hasValueback to summary
public boolean hasValue()
setback to summary
public void set(T value)