1 //
2 // THIS FILE IS AUTOMATICALLY GENERATED!!
3 //
4 // Generated at 2009-08-09 by the VDM++ to JAVA Code Generator
5 // (v8.2.1b - Wed 15-Jul-2009 14:09:22)
6 //
7 // Supported compilers: jdk 1.4/1.5/1.6
8 //
9
10 // ***** VDMTOOLS START Name=HeaderComment KEEP=NO
11 // ***** VDMTOOLS END Name=HeaderComment
12
13 // ***** VDMTOOLS START Name=package KEEP=NO
14 package org.overturetool.umltrans.uml;
15
16 // ***** VDMTOOLS END Name=package
17
18 // ***** VDMTOOLS START Name=imports KEEP=NO
19
20 import jp.co.csk.vdm.toolbox.VDM.*;
21 import java.util.*;
22 // ***** VDMTOOLS END Name=imports
23
24
25
26 public class UmlInteraction extends IUmlInteraction {
27
28 // ***** VDMTOOLS START Name=vdmComp KEEP=NO
29 static UTIL.VDMCompare vdmComp = new UTIL.VDMCompare();
30 // ***** VDMTOOLS END Name=vdmComp
31
32 // ***** VDMTOOLS START Name=ivName KEEP=NO
33 private String ivName = null;
34 // ***** VDMTOOLS END Name=ivName
35
36 // ***** VDMTOOLS START Name=ivLifeLines KEEP=NO
37 private HashSet ivLifeLines = new HashSet();
38 // ***** VDMTOOLS END Name=ivLifeLines
39
40 // ***** VDMTOOLS START Name=ivFragments KEEP=NO
41 private HashSet ivFragments = new HashSet();
42 // ***** VDMTOOLS END Name=ivFragments
43
44 // ***** VDMTOOLS START Name=ivMessages KEEP=NO
45 private Vector ivMessages = null;
46 // ***** VDMTOOLS END Name=ivMessages
47
48
49 // ***** VDMTOOLS START Name=vdm_init_UmlInteraction KEEP=NO
50 private void vdm_init_UmlInteraction () throws CGException {
51 try {
52
53 ivName = UTIL.ConvertToString(new String());
54 ivLifeLines = new HashSet();
55 ivFragments = new HashSet();
56 ivMessages = new Vector();
57 }
58 catch (Exception e){
59
60 e.printStackTrace(System.out);
61 System.out.println(e.getMessage());
62 }
63 }
64 // ***** VDMTOOLS END Name=vdm_init_UmlInteraction
65
66
67 // ***** VDMTOOLS START Name=UmlInteraction KEEP=NO
68 public UmlInteraction () throws CGException {
69 vdm_init_UmlInteraction();
70 }
71 // ***** VDMTOOLS END Name=UmlInteraction
72
73
74 // ***** VDMTOOLS START Name=identity KEEP=NO
75 public String identity () throws CGException {
76 return new String("Interaction");
77 }
78 // ***** VDMTOOLS END Name=identity
79
80
81 // ***** VDMTOOLS START Name=accept#1|IUmlVisitor KEEP=NO
82 public void accept (final IUmlVisitor pVisitor) throws CGException {
83 pVisitor.visitInteraction((IUmlInteraction) this);
84 }
85 // ***** VDMTOOLS END Name=accept#1|IUmlVisitor
86
87
88 // ***** VDMTOOLS START Name=UmlInteraction#4|String|HashSet|HashSet|Vector KEEP=NO
89 public UmlInteraction (final String p1, final HashSet p2, final HashSet p3, final Vector p4) throws CGException {
90
91 vdm_init_UmlInteraction();
92 {
93
94 setName(p1);
95 setLifeLines(p2);
96 setFragments(p3);
97 setMessages(p4);
98 }
99 }
100 // ***** VDMTOOLS END Name=UmlInteraction#4|String|HashSet|HashSet|Vector
101
102
103 // ***** VDMTOOLS START Name=UmlInteraction#6|String|HashSet|HashSet|Vector|Long|Long KEEP=NO
104 public UmlInteraction (final String p1, final HashSet p2, final HashSet p3, final Vector p4, final Long line, final Long column) throws CGException {
105
106 vdm_init_UmlInteraction();
107 {
108
109 setName(p1);
110 setLifeLines(p2);
111 setFragments(p3);
112 setMessages(p4);
113 setPosition(line, column);
114 }
115 }
116 // ***** VDMTOOLS END Name=UmlInteraction#6|String|HashSet|HashSet|Vector|Long|Long
117
118
119 // ***** VDMTOOLS START Name=init#1|HashMap KEEP=NO
120 public void init (final HashMap data) throws CGException {
121
122 {
123
124 String fname = new String("name");
125 Boolean cond_4 = null;
126 cond_4 = new Boolean(data.containsKey(fname));
127 if (cond_4.booleanValue())
128 setName(UTIL.ConvertToString(data.get(fname)));
129 }
130 {
131
132 String fname = new String("lifeLines");
133 Boolean cond_13 = null;
134 cond_13 = new Boolean(data.containsKey(fname));
135 if (cond_13.booleanValue())
136 setLifeLines((HashSet) data.get(fname));
137 }
138 {
139
140 String fname = new String("fragments");
141 Boolean cond_22 = null;
142 cond_22 = new Boolean(data.containsKey(fname));
143 if (cond_22.booleanValue())
144 setFragments((HashSet) data.get(fname));
145 }
146 {
147
148 String fname = new String("messages");
149 Boolean cond_31 = null;
150 cond_31 = new Boolean(data.containsKey(fname));
151 if (cond_31.booleanValue())
152 setMessages((Vector) data.get(fname));
153 }
154 }
155 // ***** VDMTOOLS END Name=init#1|HashMap
156
157
158 // ***** VDMTOOLS START Name=getName KEEP=NO
159 public String getName () throws CGException {
160 return ivName;
161 }
162 // ***** VDMTOOLS END Name=getName
163
164
165 // ***** VDMTOOLS START Name=setName#1|String KEEP=NO
166 public void setName (final String parg) throws CGException {
167 ivName = UTIL.ConvertToString(UTIL.clone(parg));
168 }
169 // ***** VDMTOOLS END Name=setName#1|String
170
171
172 // ***** VDMTOOLS START Name=getLifeLines KEEP=NO
173 public HashSet getLifeLines () throws CGException {
174 return ivLifeLines;
175 }
176 // ***** VDMTOOLS END Name=getLifeLines
177
178
179 // ***** VDMTOOLS START Name=setLifeLines#1|HashSet KEEP=NO
180 public void setLifeLines (final HashSet parg) throws CGException {
181 ivLifeLines = (HashSet) UTIL.clone(parg);
182 }
183 // ***** VDMTOOLS END Name=setLifeLines#1|HashSet
184
185
186 // ***** VDMTOOLS START Name=addLifeLines#1|IUmlNode KEEP=NO
187 public void addLifeLines (final IUmlNode parg) throws CGException {
188 ivLifeLines.add(parg);
189 }
190 // ***** VDMTOOLS END Name=addLifeLines#1|IUmlNode
191
192
193 // ***** VDMTOOLS START Name=getFragments KEEP=NO
194 public HashSet getFragments () throws CGException {
195 return ivFragments;
196 }
197 // ***** VDMTOOLS END Name=getFragments
198
199
200 // ***** VDMTOOLS START Name=setFragments#1|HashSet KEEP=NO
201 public void setFragments (final HashSet parg) throws CGException {
202 ivFragments = (HashSet) UTIL.clone(parg);
203 }
204 // ***** VDMTOOLS END Name=setFragments#1|HashSet
205
206
207 // ***** VDMTOOLS START Name=addFragments#1|IUmlNode KEEP=NO
208 public void addFragments (final IUmlNode parg) throws CGException {
209 ivFragments.add(parg);
210 }
211 // ***** VDMTOOLS END Name=addFragments#1|IUmlNode
212
213
214 // ***** VDMTOOLS START Name=getMessages KEEP=NO
215 public Vector getMessages () throws CGException {
216 return ivMessages;
217 }
218 // ***** VDMTOOLS END Name=getMessages
219
220
221 // ***** VDMTOOLS START Name=setMessages#1|Vector KEEP=NO
222 public void setMessages (final Vector parg) throws CGException {
223 ivMessages = (Vector) UTIL.ConvertToList(UTIL.clone(parg));
224 }
225 // ***** VDMTOOLS END Name=setMessages#1|Vector
226
227
228 // ***** VDMTOOLS START Name=addMessages#1|IUmlNode KEEP=NO
229 public void addMessages (final IUmlNode parg) throws CGException {
230 ivMessages.add(parg);
231 }
232 // ***** VDMTOOLS END Name=addMessages#1|IUmlNode
233
234 }
235 ;