
ComponentRelation |
ptolemy.kernel.ComponentRelation |
This class defines a relation supporting hierarchy (clustered graphs).
Specifically, a method is added for defining a container and for
performing deep traversals of
a graph. Most importantly, however, instances of this class refuse to link
to ports that are not instances of ComponentPort. Thus, this class
ensures that ComponentPort instances are only connected to other
ComponentPort instances.
Derived classes may wish to further constrain linked ports to a subclass
of ComponentPort, or to disallow links under other circumstances,
for example if the relation cannot support any more links.
Such derived classes should override the protected method _checkPort()
to throw an exception.
To link a ComponentPort to a ComponentRelation, use the link() or
liberalLink() method in the ComponentPort class. To remove a link,
use the unlink() method.
The container for instances of this class can only be instances of
ComponentEntity. Derived classes may wish to further constrain the
container to subclasses of ComponentEntity. To do this, they should
override the protected _checkContainer() method.
Author(s): Edward A. Lee
Version:$Id: ComponentRelation.java,v 1.89 2005/10/24 19:09:11 cxh Exp $
Pt.Proposed Rating:Green (eal)
Pt.Accepted Rating:Green (johnr)