RxJava



rx.subscriptions
Class CompositeSubscription

java.lang.Object
  extended by rx.subscriptions.CompositeSubscription
All Implemented Interfaces:
Subscription

public class CompositeSubscription
extends java.lang.Object
implements Subscription

Subscription that represents a group of Subscriptions that are unsubscribed together.

See Also:
Rx.Net equivalent CompositeDisposable

Constructor Summary
CompositeSubscription(java.util.List<Subscription> subscriptions)
           
CompositeSubscription(Subscription... subscriptions)
           
 
Method Summary
 void add(Subscription s)
           
 void clear()
          Remove and unsubscribe all subscriptions but do not unsubscribe the outer CompositeSubscription.
 boolean isUnsubscribed()
           
 void remove(Subscription s)
          Remove the Subscription and unsubscribe it.
 void unsubscribe()
          Stop receiving notifications on the Observer that was registered when this Subscription was received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeSubscription

public CompositeSubscription(java.util.List<Subscription> subscriptions)

CompositeSubscription

public CompositeSubscription(Subscription... subscriptions)
Method Detail

clear

public void clear()
Remove and unsubscribe all subscriptions but do not unsubscribe the outer CompositeSubscription.


remove

public void remove(Subscription s)
Remove the Subscription and unsubscribe it.

Parameters:
s -

isUnsubscribed

public boolean isUnsubscribed()

add

public void add(Subscription s)

unsubscribe

public void unsubscribe()
Description copied from interface: Subscription
Stop receiving notifications on the Observer that was registered when this Subscription was received.

This allows unregistering an Observer before it has finished receiving all events (ie. before onCompleted is called).

Specified by:
unsubscribe in interface Subscription