Package org.reactfx
Interface Subscription
- All Known Implementing Classes:
BiSubscription
,MultiSubscription
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault Subscription
and
(Subscription other) Returns a new aggregate subscription whoseunsubscribe()
method callsunsubscribe()
on both this subscription andother
subscription.static <T> Subscription
dynamic
(javafx.collections.ObservableSet<T> elems, Function<? super T, ? extends Subscription> f) Dynamically subscribes to all elements of the given observable set.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.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.static Subscription
multi
(Subscription... subs) Returns a new aggregate subscription whoseunsubscribe()
method callsunsubscribe()
on all arguments to this method.void
-
Field Details
-
EMPTY
-
-
Method Details
-
unsubscribe
void unsubscribe() -
and
Returns a new aggregate subscription whoseunsubscribe()
method callsunsubscribe()
on both this subscription andother
subscription. -
multi
Returns a new aggregate subscription whoseunsubscribe()
method callsunsubscribe()
on all arguments to this method. -
multi
@SafeVarargs 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. -
multi
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. -
dynamic
static <T> Subscription dynamic(javafx.collections.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
- observable set of elements that will be subscribed tof
- function to subscribe to an element of the set.- 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.
-