1 /* $Id: Connection.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.datamodel.pn;
4 import dol.visitor.PNVisitor;
7 * This class defines a connection.
8 * A connection contains one origin and one target resource and the
11 public class Connection extends Resource {
14 * Constructor to create a Connection with a name,
15 * empty process list and empty channel list.
17 public Connection(String name) {
24 * @param x visitor object
26 public void accept(PNVisitor x) {
27 x.visitComponent(this);
31 * Clone this Connection.
33 * @return a new instance of the Connection.
35 public Object clone() {
36 Connection newObj = (Connection) super.clone();
37 newObj.setOrigin(_origin);
38 newObj.setOriginPort(_originPort);
39 newObj.setTarget(_target);
40 newObj.setTargetPort(_targetPort);
45 * Return a string representation of the connection.
47 * @return string representation of the connection
49 public String toString() {
50 return "Connection: " + getName();
55 * Get the origin resource of his connection.
57 * @return origin resource
59 public Resource getOrigin() {
64 * Set the origin resource of this connection.
66 * @param origin origin resource
68 public void setOrigin(Resource origin) {
73 * Get the origin port of this connection.
77 public Port getOriginPort() {
82 * Set the origin port of this connection.
84 * @param port origin port
86 public void setOriginPort(Port port) {
91 * Get the target resource of his connection.
93 * @return target resource
95 public Resource getTarget() {
100 * Set the target resource of this connection.
102 * @param target target resource
104 public void setTarget(Resource target) {
109 * Get the target port of this connection.
111 * @return target port
113 public Port getTargetPort() {
118 * Set the target port of this connection.
120 * @param port target port
122 public void setTargetPort(Port port) {
126 protected Resource _origin;
127 protected Port _originPort;
128 protected Resource _target;
129 protected Port _targetPort;