Top Description Inners Fields Constructors Methods
rx.subscriptions

public final Class RefCountSubscription

extends Object
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription
Imports
java.util.concurrent.atomic.AtomicInteger, .AtomicReference, rx.Subscription

Keeps track of the sub-subscriptions and unsubscribes the underlying subscription once all sub-subscriptions have unsubscribed.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
RefCountSubscription.InnerSubscription

The individual sub-subscriptions.

pack-priv static class

Field Summary

Modifier and TypeField and Description
private final Subscription
pack-priv static final RefCountSubscription.State
pack-priv final AtomicReference<RefCountSubscription.State>

Constructor Summary

AccessConstructor and Description
public
RefCountSubscription(Subscription
the Subscription to wrap
s
)

Creates a RefCountSubscription by wrapping the given non-null Subscription.

Method Summary

Modifier and TypeMethod and Description
public Subscription

Returns:

a new sub-subscription.
get
()

Returns a new sub-subscription

public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

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

Implements rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.
pack-priv void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

actualback to summary
private final Subscription actual
EMPTY_STATEback to summary
pack-priv static final RefCountSubscription.State EMPTY_STATE
stateback to summary
pack-priv final AtomicReference<RefCountSubscription.State> state

Constructor Detail

RefCountSubscriptionback to summary
public RefCountSubscription(Subscription s)

Creates a RefCountSubscription by wrapping the given non-null Subscription.

Parameters
s:Subscription

the Subscription to wrap

Exceptions
IllegalArgumentException:
if s is null

Method Detail

getback to summary
public Subscription get()

Returns a new sub-subscription

Returns:Subscription

a new sub-subscription.

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
unsubscribeback to summary
public void unsubscribe()

Implements rx.Subscription.unsubscribe.

Doc from rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.

This allows deregistering an Subscriber before it has finished receiving all events (i.e. before onCompleted is called).

Annotations
@Override
unsubscribeAChildback to summary
pack-priv void unsubscribeAChild()
unsubscribeActualIfApplicableback to summary
private void unsubscribeActualIfApplicable(RefCountSubscription.State state)
rx.subscriptions back to summary

pack-priv final Class RefCountSubscription.InnerSubscription

extends AtomicInteger
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription

The individual sub-subscriptions.

Field Summary

Modifier and TypeField and Description
pack-priv final RefCountSubscription
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

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

Implements rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.
Inherited from java.util.concurrent.atomic.AtomicInteger:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

parentback to summary
pack-priv final RefCountSubscription parent
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicInteger.serialVersionUID.

Constructor Detail

InnerSubscriptionback to summary
public InnerSubscription(RefCountSubscription parent)

Method Detail

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
unsubscribeback to summary
public void unsubscribe()

Implements rx.Subscription.unsubscribe.

Doc from rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.

This allows deregistering an Subscriber before it has finished receiving all events (i.e. before onCompleted is called).

Annotations
@Override
rx.subscriptions back to summary

pack-priv final Class RefCountSubscription.State

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
State(boolean u, int c)

Method Summary

Modifier and TypeMethod and Description
pack-priv RefCountSubscription.State
pack-priv RefCountSubscription.State
pack-priv RefCountSubscription.State
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

childrenback to summary
pack-priv final int children
isUnsubscribedback to summary
pack-priv final boolean isUnsubscribed

Constructor Detail

Stateback to summary
pack-priv State(boolean u, int c)

Method Detail

addChildback to summary
pack-priv RefCountSubscription.State addChild()
removeChildback to summary
pack-priv RefCountSubscription.State removeChild()
unsubscribeback to summary
pack-priv RefCountSubscription.State unsubscribe()