Package com.complexible.common.base

# Class Disposer

java.lang.Object
com.complexible.common.base.Disposer

All Implemented Interfaces:
  `Disposable`

public final class Disposer extends Object implements Disposable

Utility for tracking and mass `Disposable.dispose()` of `Disposable` resources.

Since:
  5.0
Version:
  5.0
Author:
  Michael Grove

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Disposer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dispose()`
  Dispose the resources held by this object.
  `<T extends Disposable>
  T`
  `register(T theToDispose)`
  Add a new `Disposable` for tracking to this `Disposer`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Disposer

    public Disposer()

- ## Method Details

  - ### register

    public <T extends Disposable> T register(T theToDispose)
    Add a new `Disposable` for tracking to this `Disposer`
    Parameters:
      `theToDispose` - the object to eventually dispose of
    Returns:
      this disposer

  - ### dispose

    public void dispose()
    Dispose the resources held by this object. Use this function with care since disposed objects cannot be reused again. If the resources (files, pages, etc.) held by this object will be needed again calling `Closeable.close()` or some other method will be more appropriate.
    Specified by:
      `dispose` in interface `Disposable`