Class ListCompositeDisposable

java.lang.Object
io.reactivex.rxjava3.internal.disposables.ListCompositeDisposable
All Implemented Interfaces:
Disposable, DisposableContainer

public final class ListCompositeDisposable extends Object implements Disposable, DisposableContainer
A disposable container that can hold onto multiple other disposables.
  • Field Details

    • resources

      List<Disposable> resources
    • disposed

      volatile boolean disposed
  • Constructor Details

    • ListCompositeDisposable

      public ListCompositeDisposable()
    • ListCompositeDisposable

      public ListCompositeDisposable(Disposable... resources)
    • ListCompositeDisposable

      public ListCompositeDisposable(Iterable<? extends Disposable> resources)
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Dispose the resource, the operation should be idempotent.
      Specified by:
      dispose in interface Disposable
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: Disposable
      Returns true if this resource has been disposed.
      Specified by:
      isDisposed in interface Disposable
      Returns:
      true if this resource has been disposed
    • add

      public boolean add(Disposable d)
      Description copied from interface: DisposableContainer
      Adds a disposable to this container or disposes it if the container has been disposed.
      Specified by:
      add in interface DisposableContainer
      Parameters:
      d - the disposable to add, not null
      Returns:
      true if successful, false if this container has been disposed
    • addAll

      public boolean addAll(Disposable... ds)
    • remove

      public boolean remove(Disposable d)
      Description copied from interface: DisposableContainer
      Removes and disposes the given disposable if it is part of this container.
      Specified by:
      remove in interface DisposableContainer
      Parameters:
      d - the disposable to remove and dispose, not null
      Returns:
      true if the operation was successful
    • delete

      public boolean delete(Disposable d)
      Description copied from interface: DisposableContainer
      Removes but does not dispose the given disposable if it is part of this container.
      Specified by:
      delete in interface DisposableContainer
      Parameters:
      d - the disposable to remove, not null
      Returns:
      true if the operation was successful
    • clear

      public void clear()
    • dispose

      void dispose(List<Disposable> set)