Disposables and
offers O(1) time complexity for add(Disposable), remove(Disposable) and delete(Disposable)
operations.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile boolean | |
| pack-priv OpenHashSet |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CompositeDisposable(@NonNull Disposable...
the array of disposables)Disposables to start withCreates a |
| public | CompositeDisposable(@NonNull Iterable<? extends Disposable>
the disposables)Iterable sequence of Disposable to start withCreates a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if successful, false if this container has been disposedthe disposable)Disposable to add, not nullImplements io. Disposable to this container or disposes it if the
container has been disposed.
|
| public boolean | Returns: true if the operation was successful, false if the container has been disposedthe array of disposables)DisposablesAtomically adds the given array of |
| public void | |
| public boolean | Returns: true if the operation was successfulthe disposable to remove, not disposable)nullImplements io. Disposable if it is part of this
container.
|
| public void | dispose()
Implements io. |
| pack-priv void | dispose(@Nullable OpenHashSet<Disposable>
the set)OpenHashSet to dispose elements ofDispose the contents of the |
| public boolean | isDisposed()
Implements io. |
| public boolean | Returns: true if the operation was successfulthe disposable to remove and dispose, not disposable)nullImplements io. Disposable if it is part of this
container.
|
| public int | Returns: the number of currently heldDisposablesReturns the number of currently held |
| disposed | back to summary |
|---|---|
| pack-priv volatile boolean disposed | |
| resources | back to summary |
|---|---|
| pack-priv OpenHashSet<Disposable> resources | |
| CompositeDisposable | back to summary |
|---|---|
| public CompositeDisposable() Creates an empty | |
| CompositeDisposable | back to summary |
|---|---|
| public CompositeDisposable(@NonNull Disposable... disposables) Creates a
| |
| CompositeDisposable | back to summary |
|---|---|
| public CompositeDisposable(@NonNull Iterable<? extends Disposable> disposables) Creates a
| |
| add | back to summary |
|---|---|
| public boolean add(@NonNull Disposable disposable) Implements io. Adds a
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(@NonNull Disposable... disposables) Atomically adds the given array of
| |
| clear | back to summary |
|---|---|
| public void clear() Atomically clears the container, then disposes all the previously contained | |
| delete | back to summary |
|---|---|
| public boolean delete(@NonNull Disposable disposable) Implements io. Removes (but does not dispose) the given
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| dispose | back to summary |
|---|---|
| pack-priv void dispose(@Nullable OpenHashSet<Disposable> set) Dispose the contents of the
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| remove | back to summary |
|---|---|
| public boolean remove(@NonNull Disposable disposable) Implements io. Removes and disposes the given
| |
| size | back to summary |
|---|---|
| public int size() Returns the number of currently held
| |