gumbo.util
Interface Disposable

All Known Subinterfaces:
Associate, AxisLayoutGraphic, GraphicPresence, GraphicResource, GraphicShape, GraphicView, KeyboardSensor, MouseSensor, Relation, SelectableShape, TreeNode
All Known Implementing Classes:
AbstractAssociate, AbstractDisposable, AbstractKeyboardSensor, AbstractMouseSensor, AbstractRelation, AbstractTreeNode, AbstractTreeNodeDelegator, Disposables.DisposableImm, Disposables.DisposableWrapper, NullGraphicView, Relations.RelationImm, Relations.RelationWrapper, SwingDataProxy, SwingDataShape, SwingGraphView, SwingListView, SwingShape, SwingSpaceNode, SwingTreeView, TreeNodes.TreeNodeImm, TreeNodes.TreeNodeWrapper

public interface Disposable

An interface marking this object as being "disposable". Disposing an object should immediately dispose all system resources, disconnect all navigable links (data relationships), null all external references, and render this object unusable (accessors throw IllegalStateException and/or NullPointerException). Disposal may be neccessary, such as when system resources need to be freed immediately rather than waiting for finalization, or it may be a convenience, such as a delegator eliminating its delegate node in a navigable data structure.

Disposal should chain to the super class (like finalize()). Calling dispose() may call dispose() recursively or mutually on disposable dependencies, such as the parent or children in a containment pattern. Such situations generally require detection and blocking of disposal cycles (see AbstractDisposable).

Depending on the nature of the disposal this object's Object.finalize() method may need to call dispose(). Note, however, that finalize() can seriously impact garbage collection performance, and its use should be carefully considered.

Version:
$Revision: 1.7 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
 void dispose()
          Disposes this object and its dependencies, making this object inactive and unusable.
 boolean isDisposed()
          Returns whether or not this object has been disposed (dispose() has been previously called).
 

Method Detail

dispose

public void dispose()
Disposes this object and its dependencies, making this object inactive and unusable. Subsequent calls to this object's accessors should throw IllegalStateException. If the object is already disposed nothing happens.


isDisposed

public boolean isDisposed()
Returns whether or not this object has been disposed (dispose() has been previously called).

Returns:
True if this object has been disposed.