Top Description Fields Constructors Methods
rx.internal.util

public final Class SubscriptionList

extends Object
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription
Imports
java.util.*, rx.Subscription, rx.exceptions.Exceptions

Subscription that represents a group of Subscriptions that are unsubscribed together.
See Also
Rx.Net equivalent CompositeDisposable

Field Summary

Modifier and TypeField and Description
private List<Subscription>
private volatile boolean

Constructor Summary

AccessConstructor and Description
public
SubscriptionList()

Constructs an empty SubscriptionList.

public
SubscriptionList(final Subscription...
the array of subscriptions to start with
subscriptions
)

Constructs a SubscriptionList with the given initial child subscriptions.

public
SubscriptionList(Subscription
the initial subscription instance
s
)

Constructs a SubscriptionList with the given initial child subscription.

Method Summary

Modifier and TypeMethod and Description
public void
add(final Subscription
the Subscription to add
s
)

Adds a new Subscription to this SubscriptionList if the SubscriptionList is not yet unsubscribed.

public void
public boolean

Returns:

true if this composite is not unsubscribed and contains subscriptions.
hasSubscriptions
()

Returns true if this composite is not unsubscribed and contains subscriptions.

public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
public void
public void
unsubscribe()

Implements rx.Subscription.unsubscribe.

Unsubscribe from all of the subscriptions in the list, which stops the receipt of notifications on the associated Subscriber.
private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

subscriptionsback to summary
private List<Subscription> subscriptions
unsubscribedback to summary
private volatile boolean unsubscribed

Constructor Detail

SubscriptionListback to summary
public SubscriptionList()

Constructs an empty SubscriptionList.

SubscriptionListback to summary
public SubscriptionList(final Subscription... subscriptions)

Constructs a SubscriptionList with the given initial child subscriptions.

Parameters
subscriptions:Subscription[]

the array of subscriptions to start with

SubscriptionListback to summary
public SubscriptionList(Subscription s)

Constructs a SubscriptionList with the given initial child subscription.

Parameters
s:Subscription

the initial subscription instance

Method Detail

addback to summary
public void add(final Subscription s)

Adds a new Subscription to this SubscriptionList if the SubscriptionList is not yet unsubscribed. If the SubscriptionList is unsubscribed, add will indicate this by explicitly unsubscribing the new Subscription as well.

Parameters
s:Subscription

the Subscription to add

clearback to summary
public void clear()
hasSubscriptionsback to summary
public boolean hasSubscriptions()

Returns true if this composite is not unsubscribed and contains subscriptions.

Returns:boolean

true if this composite is not unsubscribed and contains subscriptions.

isUnsubscribedback to summary
public boolean isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Doc from rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.

Returns:boolean

true if this Subscription is currently unsubscribed, false otherwise

Annotations
@Override
removeback to summary
public void remove(final Subscription s)
unsubscribeback to summary
public void unsubscribe()

Implements rx.Subscription.unsubscribe.

Unsubscribe from all of the subscriptions in the list, which stops the receipt of notifications on the associated Subscriber.

Annotations
@Override
unsubscribeFromAllback to summary
private static void unsubscribeFromAll(Collection<Subscription> subscriptions)