public class DataSubscriptionList extends java.lang.Object implements DataSubscription
DataSubscription objects, which can be canceled with a single cancel() call.
This is typically used in live cycle components like Android's Activity:
add(DataSubscription) during onStart/onResume for each subscriptioncancel() during onStop/onPause| Constructor and Description |
|---|
DataSubscriptionList() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(DataSubscription subscription)
Add the given subscription to the list of tracked subscriptions.
|
void |
cancel()
Cancels all tracked subscriptions and removes all references to them.
|
int |
getActiveSubscriptionCount()
Returns number of active (added) subscriptions (resets to 0 after
cancel()). |
boolean |
isCanceled()
Returns true if
cancel() was called without any subsequent calls to add(DataSubscription). |
public void add(DataSubscription subscription)
public void cancel()
cancel in interface DataSubscriptionpublic boolean isCanceled()
cancel() was called without any subsequent calls to add(DataSubscription).isCanceled in interface DataSubscriptionpublic int getActiveSubscriptionCount()
cancel()).