dol: initial dol commit
[jump.git] / dol / src / dol / datamodel / architecture / ArchiConnection.java
1 /* $Id: ArchiConnection.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.datamodel.architecture;
3
4 import dol.visitor.ArchiVisitor;
5
6 /**
7  * This class defines an architecture connection. Used in the simplified
8  * architecture specification. An architecture connection contains one
9  * origin and one target resource.
10  */
11 public class ArchiConnection extends ArchiResource {
12     /**
13      * Constructor to create an architecture connection with a name.
14      *
15      */
16     public ArchiConnection(String name) {
17       super(name);
18     }
19
20     /**
21      * Accept a Visitor.
22      *
23      * @param x visitor object
24      */
25     public void accept(ArchiVisitor x) {
26         x.visitComponent(this);
27     }
28
29     /**
30      * Clone this architectural connection.
31      *
32      * @return  a new instance of the architectural connection.
33      */
34     public Object clone() {
35         ArchiConnection newObj = (ArchiConnection) super.clone();
36         newObj.setOrigin(_origin);
37         newObj.setTarget(_target);
38         return (newObj);
39     }
40
41     /**
42      * Return a string representation of the architectural connection.
43      *
44      * @return string representation of the architectural connection
45      */
46     public String toString() {
47         return "ArchiConnection: " + getName();
48     }
49
50     /**
51      * Return the origin of the architectural connection.
52      *
53      * @return origin architectural resource of the architectural connection
54      */
55     public ArchiResource getOrigin() { return _origin; }
56
57     /**
58      * Set the origin of the architectural connection.
59      *
60      * @param origin architectural resource.
61      */
62     public void setOrigin(ArchiResource origin) { _origin = origin; }
63
64     /**
65      * Return the target of the architectural connection.
66      *
67      * @return target architectural resource of the architectural connection
68      */
69     public ArchiResource getTarget() { return _target; }
70
71     /**
72      * Set the target of the architectural connection.
73      *
74      * @param target architectural resource.
75      */
76     public void setTarget(ArchiResource target) { _target = target; }
77
78     protected ArchiResource _origin;
79     protected ArchiResource _target;
80 }