public class CompositeDisposable extends java.lang.Object implements Disposable
Disposable
, you register instance of this class in Disposer
.
Call add(Disposable)
to request automatic disposal of additional objects.
Comparing to registering these additional disposables with Disposer one by one,
this class improves on the memory usage by not creating temporary objects inside Disposer.Disposable.Parent
Constructor and Description |
---|
CompositeDisposable() |
Modifier and Type | Method and Description |
---|---|
void |
add(Disposable disposable) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
remove(Disposable disposable)
Removes the given disposable from this composite.
|
public void add(Disposable disposable)
public void remove(Disposable disposable)
disposable
- the disposable to remove from this CompositeDisposablepublic void dispose()
Disposable
dispose
in interface Disposable