|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.Relation
A Relation links ports, and therefore the entities that contain them. To link a port to a relation, use the link() method in the Port class. To remove a link, use the unlink() method in the Port class.
Derived classes may wish to disallow links under certain circumstances, for example if the proposed port is not an instance of an appropriate subclass of Port, or if the relation cannot support any more links. Such derived classes should override the protected method _checkPort() to throw an exception.
Port,
Entity,
Serialized Form
| Green (johnr) |
| Green (eal) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.util.NamedObj |
NamedObj.ContainedObjectsIterator |
| Field Summary |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Constructor Summary | |
Relation()
Construct a relation in the default workspace with an empty string as its name. |
|
Relation(java.lang.String name)
Construct a relation in the default workspace with the given name. |
|
Relation(Workspace workspace)
Construct a relation in the given workspace with an empty string as a name. |
|
Relation(Workspace workspace,
java.lang.String name)
Construct a relation in the given workspace with the given name. |
|
| Method Summary | |
protected void |
_checkPort(Port port)
Throw an exception if the specified port cannot be linked to this relation. |
protected java.lang.String |
_description(int detail,
int indent,
int bracket)
Return a description of the object. |
protected NamedObj |
_getContainedObject(NamedObj container,
java.lang.String relativeName)
Get a relation with the specified name in the specified container. |
protected CrossRefList |
_getPortList()
Return a reference to the local port list. |
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace. |
java.util.List |
linkedPortList()
List the linked ports. |
java.util.List |
linkedPortList(Port except)
List the linked ports except the specified port. |
java.util.Enumeration |
linkedPorts()
Enumerate the linked ports. |
java.util.Enumeration |
linkedPorts(Port except)
Deprecated. Use linkedPortList() instead. |
int |
numLinks()
Return the number of links to ports. |
void |
unlinkAll()
Unlink all ports. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Relation()
public Relation(java.lang.String name)
throws IllegalActionException
name - Name of this object.
IllegalActionException - If the name has a period.public Relation(Workspace workspace)
workspace - The workspace for synchronization and version tracking.
public Relation(Workspace workspace,
java.lang.String name)
throws IllegalActionException
workspace - Workspace for synchronization and version trackingname - Name of this object.
IllegalActionException - If the name has a period.| Method Detail |
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
clone in class NamedObjworkspace - The workspace for the cloned object.
java.lang.CloneNotSupportedException - If one of the attributes cannot
be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public java.util.List linkedPortList()
public java.util.List linkedPortList(Port except)
except - Port to exclude from the enumeration.
public java.util.Enumeration linkedPorts()
public java.util.Enumeration linkedPorts(Port except)
except - Port to exclude from the enumeration.
public int numLinks()
public void unlinkAll()
protected void _checkPort(Port port)
throws IllegalActionException
port - The port to link to.
IllegalActionException - Not thrown in this base class.
protected java.lang.String _description(int detail,
int indent,
int bracket)
_description in class NamedObjdetail - The level of detail.indent - The amount of indenting.bracket - The number of surrounding brackets (0, 1, or 2).
protected NamedObj _getContainedObject(NamedObj container,
java.lang.String relativeName)
throws IllegalActionException
_getContainedObject in class NamedObjrelativeName - The name relative to the container.container - The container expected to contain the object, which
must be an instance of CompositeEntity.
IllegalActionException - If the object exists
and has the wrong class, or if the specified container is not
an instance of CompositeEntity.protected CrossRefList _getPortList()
Port
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||