dol: initial dol commit
[jump.git] / dol / src / dol / datamodel / mapping / CommunicationBinding.java
1 /* $Id: CommunicationBinding.java 1 2010-02-24 13:03:05Z haidw $ */\r
2 package dol.datamodel.mapping;\r
3 \r
4 import dol.datamodel.architecture.ReadPath;\r
5 import dol.datamodel.architecture.WritePath;\r
6 import dol.datamodel.pn.Channel;\r
7 import dol.visitor.MapVisitor;\r
8 \r
9 /**\r
10  * This class represents a communication binding element in the mapping.\r
11  */\r
12 public class CommunicationBinding extends Binding {\r
13 \r
14     /**\r
15      * Constructor to create a CommunicationBinding with a name.\r
16      */\r
17     public CommunicationBinding(String name) {\r
18         super(name);\r
19         _type = COMMUNICATION;\r
20     }\r
21 \r
22     /**\r
23      * Clone this Binding\r
24      *\r
25      * @return a new instance of the Binding.\r
26      */\r
27     public Object clone() {\r
28         CommunicationBinding newObj = (CommunicationBinding) super.clone();\r
29         newObj.setChannel(_channel);\r
30         newObj.setReadPath(_readPath);\r
31         newObj.setWritePath(_writePath);\r
32         return (newObj);\r
33     }\r
34 \r
35     /**\r
36      * Accept a Visitor\r
37      *\r
38      * @param x visitor object\r
39      */\r
40     public void accept(MapVisitor x) {\r
41         x.visitComponent(this);\r
42     }\r
43 \r
44     /** Set the SW channel */\r
45     public void setChannel(Channel c) {\r
46         _channel = c;\r
47     }\r
48 \r
49     /** Get the SW channel */\r
50     public Channel getChannel() {\r
51         return _channel;\r
52     }\r
53 \r
54     /** Set the read path */\r
55     public void setReadPath(ReadPath p) {\r
56         _readPath = p;\r
57     }\r
58 \r
59     /** Get the read path */\r
60     public ReadPath getReadPath() {\r
61         return _readPath;\r
62     }\r
63 \r
64     /** Set the write path */\r
65     public void setWritePath(WritePath p) {\r
66         _writePath = p;\r
67     }\r
68 \r
69     /** Get the write path */\r
70     public WritePath getWritePath() {\r
71         return _writePath;\r
72     }\r
73 \r
74     /**\r
75      * Return a description of the binding.\r
76      *\r
77      * @return a description of the binding.\r
78      */\r
79     public String toString() {\r
80         return "CommunicationBinding: " + getName() ;\r
81     }\r
82 \r
83     private Channel _channel = null;\r
84 \r
85     private ReadPath _readPath = null;\r
86 \r
87     private WritePath _writePath = null;\r
88 \r
89 }\r