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.

@FunctionalInterface public interface Subscription
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Subscription
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default Subscription
    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, 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.
    Returns a new aggregate subscription whose unsubscribe() method calls unsubscribe() on all arguments to this method.
    void
     
  • Field Details

  • Method Details

    • unsubscribe

      void unsubscribe()
    • and

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

      static Subscription multi(Subscription... subs)
      Returns a new aggregate subscription whose unsubscribe() method calls unsubscribe() 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

      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.
    • 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 to
      f - 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.