@FunctionalInterface
public interface Subscription
| Modifier and Type | Field and Description |
|---|---|
static Subscription |
EMPTY |
| Modifier and Type | Method and Description |
|---|---|
default Subscription |
and(Subscription other)
Returns a new aggregate subscription whose
unsubscribe()
method calls unsubscribe() on both this subscription and
other subscription. |
static <T> Subscription |
dynamic(javafx.collections.ObservableSet<T> elems,
java.util.function.Function<? super T,? extends Subscription> f)
Dynamically subscribes to all elements of the given observable set.
|
static <T> Subscription |
multi(java.util.function.Function<? super T,? extends Subscription> f,
java.util.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(java.util.function.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 whose
unsubscribe()
method calls unsubscribe() on all arguments to this method. |
void |
unsubscribe() |
static final Subscription EMPTY
void unsubscribe()
default Subscription and(Subscription other)
unsubscribe()
method calls unsubscribe() on both this subscription and
other subscription.static Subscription multi(Subscription... subs)
unsubscribe()
method calls unsubscribe() on all arguments to this method.@SafeVarargs static <T> Subscription multi(java.util.function.Function<? super T,? extends Subscription> f, T... elems)
static <T> Subscription multi(java.util.function.Function<? super T,? extends Subscription> f, java.util.Collection<T> elems)
static <T> Subscription dynamic(javafx.collections.ObservableSet<T> elems, java.util.function.Function<? super T,? extends Subscription> f)
elems - observable set of elements that will be subscribed tof - function to subscribe to an element of the set.