dol: initial dol commit
[jump.git] / dol / src / dol / datamodel / architecture / ArchiConnection.java
diff --git a/dol/src/dol/datamodel/architecture/ArchiConnection.java b/dol/src/dol/datamodel/architecture/ArchiConnection.java
new file mode 100644 (file)
index 0000000..9e2d713
--- /dev/null
@@ -0,0 +1,80 @@
+/* $Id: ArchiConnection.java 1 2010-02-24 13:03:05Z haidw $ */
+package dol.datamodel.architecture;
+
+import dol.visitor.ArchiVisitor;
+
+/**
+ * This class defines an architecture connection. Used in the simplified
+ * architecture specification. An architecture connection contains one
+ * origin and one target resource.
+ */
+public class ArchiConnection extends ArchiResource {
+    /**
+     * Constructor to create an architecture connection with a name.
+     *
+     */
+    public ArchiConnection(String name) {
+      super(name);
+    }
+
+    /**
+     * Accept a Visitor.
+     *
+     * @param x visitor object
+     */
+    public void accept(ArchiVisitor x) {
+        x.visitComponent(this);
+    }
+
+    /**
+     * Clone this architectural connection.
+     *
+     * @return  a new instance of the architectural connection.
+     */
+    public Object clone() {
+        ArchiConnection newObj = (ArchiConnection) super.clone();
+        newObj.setOrigin(_origin);
+        newObj.setTarget(_target);
+        return (newObj);
+    }
+
+    /**
+     * Return a string representation of the architectural connection.
+     *
+     * @return string representation of the architectural connection
+     */
+    public String toString() {
+        return "ArchiConnection: " + getName();
+    }
+
+    /**
+     * Return the origin of the architectural connection.
+     *
+     * @return origin architectural resource of the architectural connection
+     */
+    public ArchiResource getOrigin() { return _origin; }
+
+    /**
+     * Set the origin of the architectural connection.
+     *
+     * @param origin architectural resource.
+     */
+    public void setOrigin(ArchiResource origin) { _origin = origin; }
+
+    /**
+     * Return the target of the architectural connection.
+     *
+     * @return target architectural resource of the architectural connection
+     */
+    public ArchiResource getTarget() { return _target; }
+
+    /**
+     * Set the target of the architectural connection.
+     *
+     * @param target architectural resource.
+     */
+    public void setTarget(ArchiResource target) { _target = target; }
+
+    protected ArchiResource _origin;
+    protected ArchiResource _target;
+}