Interface DisposableContainer

All Known Implementing Classes:
CompositeDisposable, ListCompositeDisposable

public interface DisposableContainer
Common interface to add and remove disposables from a container.
Since:
2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Adds a disposable to this container or disposes it if the container has been disposed.
    boolean
    Removes but does not dispose the given disposable if it is part of this container.
    boolean
    Removes and disposes the given disposable if it is part of this container.
  • Method Details

    • add

      boolean add(Disposable d)
      Adds a disposable to this container or disposes it if the container has been disposed.
      Parameters:
      d - the disposable to add, not null
      Returns:
      true if successful, false if this container has been disposed
    • remove

      boolean remove(Disposable d)
      Removes and disposes the given disposable if it is part of this container.
      Parameters:
      d - the disposable to remove and dispose, not null
      Returns:
      true if the operation was successful
    • delete

      boolean delete(Disposable d)
      Removes but does not dispose the given disposable if it is part of this container.
      Parameters:
      d - the disposable to remove, not null
      Returns:
      true if the operation was successful