Top Fields Methods
org.reactfx

public Interface Subscription

Additional top-level classes in compilation unit: BiSubscription, MultiSubscription.

Known Direct Implementers
org.reactfx.BiSubscription, org.reactfx.MultiSubscription
Annotations
@FunctionalInterface
Imports
java.util.Collection, .HashMap, .Map, java.util.function.Function, java.util.stream.Stream, javafx.collections.ObservableSet

Field Summary

Modifier and TypeField and Description
public static final Subscription

Method Summary

Modifier and TypeMethod and Description
public default Subscription
and(Subscription other)

Returns a new aggregate subscription whose unsubscribe() method calls unsubscribe() on both this subscription and other subscription.

public static <T> Subscription

Returns:

An aggregate subscription that tracks elementary subscriptions. When the returned subscription is unsubscribed, all elementary subscriptions are unsubscribed as well, and no new elementary subscriptions will be created.
dynamic
(ObservableSet<T>
observable set of elements that will be subscribed to
elems
,
Function<? super T, ? extends Subscription>
function to subscribe to an element of the set.
f
)

Dynamically subscribes to all elements of the given observable set.

public static Subscription
multi(Subscription... subs)

Returns a new aggregate subscription whose unsubscribe() method calls unsubscribe() on all arguments to this method.

public static <T> Subscription
multi(Function<? super T, ? extends Subscription> f, T... elems)

Subscribes to all elements by the given function and returns an aggregate subscription that can be used to cancel all element subscriptions.

public static <T> Subscription
multi(Function<? super T, ? extends Subscription> f, Collection<T> elems)

Subscribes to all elements of the given collection by the given function and returns an aggregate subscription that can be used to cancel all element subscriptions.

public void

Field Detail

EMPTYback to summary
public static final Subscription EMPTY

Method Detail

andback to summary
public default Subscription and(Subscription other)

Returns a new aggregate subscription whose unsubscribe() method calls unsubscribe() on both this subscription and other subscription.

dynamicback to summary
public static <T> Subscription dynamic(ObservableSet<T> elems, Function<? super T, ? extends Subscription> f)

Dynamically subscribes to all elements of the given observable set. When an element is added to the set, it is automatically subscribed to. When an element is removed from the set, it is automatically unsubscribed from.

Parameters
elems:ObservableSet<T>

observable set of elements that will be subscribed to

f:Function<? super T, ? extends Subscription>

function to subscribe to an element of the set.

Returns:Subscription

An aggregate subscription that tracks elementary subscriptions. When the returned subscription is unsubscribed, all elementary subscriptions are unsubscribed as well, and no new elementary subscriptions will be created.

multiback to summary
public static Subscription multi(Subscription... subs)

Returns a new aggregate subscription whose unsubscribe() method calls unsubscribe() on all arguments to this method.

multiback to summary
public static <T> Subscription multi(Function<? super T, ? extends Subscription> f, T... elems)

Subscribes to all elements by the given function and returns an aggregate subscription that can be used to cancel all element subscriptions.

Annotations
@SafeVarargs
multiback to summary
public static <T> Subscription multi(Function<? super T, ? extends Subscription> f, Collection<T> elems)

Subscribes to all elements of the given collection by the given function and returns an aggregate subscription that can be used to cancel all element subscriptions.

unsubscribeback to summary
public void unsubscribe()