dol: initial dol commit
[jump.git] / dol / src / dol / datamodel / mapping / ComputationBinding.java
diff --git a/dol/src/dol/datamodel/mapping/ComputationBinding.java b/dol/src/dol/datamodel/mapping/ComputationBinding.java
new file mode 100644 (file)
index 0000000..c117265
--- /dev/null
@@ -0,0 +1,75 @@
+/* $Id: ComputationBinding.java 1 2010-02-24 13:03:05Z haidw $ */\r
+package dol.datamodel.mapping;\r
+\r
+import dol.datamodel.architecture.Processor;\r
+import dol.datamodel.pn.Process;\r
+import dol.visitor.MapVisitor;\r
+\r
+/**\r
+ * This class represents a computation binding element in the mapping.\r
+ */\r
+public class ComputationBinding extends Binding {\r
+\r
+    /**\r
+     * Constructor to create a ComputationBinding with a name.\r
+     */\r
+    public ComputationBinding(String name) {\r
+        super(name);\r
+        _type = COMPUTATION;\r
+    }\r
+\r
+    /**\r
+     * Clone this Binding\r
+     *\r
+     * @return a new instance of the Binding.\r
+     */\r
+    public Object clone() {\r
+        ComputationBinding newObj = (ComputationBinding) super.clone();\r
+        newObj.setProcessor(_processor);\r
+        newObj.setProcess(_process);\r
+        return (newObj);\r
+    }\r
+\r
+    /**\r
+     * Accept a Visitor\r
+     *\r
+     * @param x visitor object\r
+     */\r
+    public void accept(MapVisitor x) {\r
+        x.visitComponent(this);\r
+    }\r
+\r
+    /** Set the PN process */\r
+    public void setProcess(Process p) {\r
+        _process = p;\r
+    }\r
+\r
+    /** Get the PN process */\r
+    public Process getProcess() {\r
+        return _process;\r
+    }\r
+\r
+    /** Set the processor from the architecture */\r
+    public void setProcessor(Processor p) {\r
+        _processor = p;\r
+    }\r
+\r
+    /** Get the processor */\r
+    public Processor getProcessor() {\r
+        return _processor;\r
+    }\r
+\r
+    /**\r
+     * Return a description of the binding.\r
+     *\r
+     * @return a description of the binding.\r
+     */\r
+    public String toString() {\r
+        return "ComputationBinding: " + getName() ;\r
+    }\r
+\r
+    private Process _process = null;\r
+\r
+    private Processor _processor = null;\r
+\r
+}\r