CompositeDisposable

A CompositeDisposable collects together multiple Disposable objects, ensuring that when the composite is disposed, the objects contained therein are also disposed appropriately.

The CompositeDisposable class is not subclassable.

Conformed Interfaces

Conforms to the Disposable interface.

Methods

add(object)

Adds an object to the receiver, which will receive a call to dispose() when the composite object is disposed. Calling this method multiple times with the same object will only add it once. If the composite has already been disposed, this effectively does nothing.

remove(object)

Removes an object from the receiver, so that it will not receive a call to dispose() when the composite is disposed. If the composite has already been disposed, this effectively does nothing.

delete(object)

An alias for remove().

clear()

Removes all objects from the receiver, so that they will not receive a call to dispose() when the composite is disposed. If the composite has already been disposed, this effectively does nothing.

dispose()

Relinquishes the resources of all Disposable objects contained in the receiver.