
Entity |
ptolemy.kernel.Entity |
An Entity is a vertex in a generalized graph. It is an aggregation
of ports. The ports can be linked to relations. The
relations thus represent connections between ports, and hence,
connections between entities. To add a port to an entity, simply
set its container to the entity. To remove it, set its container
to null, or to some other entity.
Entities are intended for flat graphs. Derived classes support
hierarchy (clustered graphs) by defining entities that aggregate
other entities.
An Entity can contain any instance of Port. Derived classes may
wish to constrain to a subclass of Port. To do this, subclasses
should override the public method newPort() to create a port of
the appropriate subclass, and the protected method _addPort() to throw
an exception if its argument is a port that is not of the appropriate
subclass.
An Entity is created within a workspace. If the workspace is
not specified as a constructor argument, then the default workspace
is used. The workspace is used to synchronize simultaneous accesses
to a topology from multiple threads. The workspace is immutable
(it cannot be changed during the lifetime of the Entity).
Author(s): John S. Davis II, Edward A. Lee
Version:$Id: Entity.java,v 1.115 2006/03/29 20:44:10 cxh Exp $
Pt.Proposed Rating:Green (eal)
Pt.Accepted Rating:Green (johnr)