public final class CompositeDisposable extends java.lang.Object implements Disposable, io.reactivex.internal.disposables.DisposableContainer
Constructor and Description |
---|
CompositeDisposable()
Creates an empty CompositeDisposable.
|
CompositeDisposable(Disposable... resources)
Creates a CompositeDisposables with the given array of initial elements.
|
CompositeDisposable(java.lang.Iterable<? extends Disposable> resources)
Creates a CompositeDisposables with the given Iterable sequence of initial elements.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public CompositeDisposable()
public CompositeDisposable(Disposable... resources)
resources
- the array of Disposables to start withpublic CompositeDisposable(java.lang.Iterable<? extends Disposable> resources)
resources
- the Iterable sequence of Disposables to start withpublic void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
public boolean add(Disposable d)
add
in interface io.reactivex.internal.disposables.DisposableContainer
public boolean addAll(Disposable... ds)
ds
- the array of Disposablespublic boolean remove(Disposable d)
remove
in interface io.reactivex.internal.disposables.DisposableContainer
public boolean delete(Disposable d)
delete
in interface io.reactivex.internal.disposables.DisposableContainer
public void clear()
public int size()