java.lang.Object | |
↳ | io.reactivex.disposables.CompositeDisposable |
A disposable container that can hold onto multiple other disposables and offers O(1) add and removal complexity.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CompositeDisposable()
Creates an empty CompositeDisposable.
| |||||||||||
CompositeDisposable(Disposable... resources)
Creates a CompositeDisposables with the given array of initial elements.
| |||||||||||
CompositeDisposable(Iterable<? extends Disposable> resources)
Creates a CompositeDisposables with the given Iterable sequence of initial elements.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | add(Disposable d) | ||||||||||
boolean |
addAll(Disposable... ds)
Atomically adds the given array of Disposables to the container or
disposes them all if the container has been disposed.
| ||||||||||
void |
clear()
Atomically clears the container, then disposes all the previously contained Disposables.
| ||||||||||
boolean | delete(Disposable d) | ||||||||||
void |
dispose()
Dispose the resource, the operation should be idempotent.
| ||||||||||
boolean |
isDisposed()
Returns true if this resource has been disposed.
| ||||||||||
boolean | remove(Disposable d) | ||||||||||
int |
size()
Returns the number of currently held Disposables.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
io.reactivex.disposables.Disposable
| |||||||||||
From interface
io.reactivex.internal.disposables.DisposableContainer
|
Creates an empty CompositeDisposable.
Creates a CompositeDisposables with the given array of initial elements.
resources | the array of Disposables to start with |
---|
Creates a CompositeDisposables with the given Iterable sequence of initial elements.
resources | the Iterable sequence of Disposables to start with |
---|
Atomically adds the given array of Disposables to the container or disposes them all if the container has been disposed.
ds | the array of Disposables |
---|
Atomically clears the container, then disposes all the previously contained Disposables.
Dispose the resource, the operation should be idempotent.
Returns true if this resource has been disposed.
Returns the number of currently held Disposables.