diff options
Diffstat (limited to 'Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart')
12 files changed, 1749 insertions, 0 deletions
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/Entry.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/Entry.java new file mode 100644 index 00000000..10203691 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/Entry.java | |||
@@ -0,0 +1,50 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | |||
7 | /** | ||
8 | * <!-- begin-user-doc --> | ||
9 | * A representation of the model object '<em><b>Entry</b></em>'. | ||
10 | * <!-- end-user-doc --> | ||
11 | * | ||
12 | * <p> | ||
13 | * The following features are supported: | ||
14 | * </p> | ||
15 | * <ul> | ||
16 | * <li>{@link simpleStatechart.Entry#getEntry <em>Entry</em>}</li> | ||
17 | * </ul> | ||
18 | * | ||
19 | * @see simpleStatechart.SimpleStatechartPackage#getEntry() | ||
20 | * @model | ||
21 | * @generated | ||
22 | */ | ||
23 | public interface Entry extends EObject { | ||
24 | /** | ||
25 | * Returns the value of the '<em><b>Entry</b></em>' reference. | ||
26 | * <!-- begin-user-doc --> | ||
27 | * <p> | ||
28 | * If the meaning of the '<em>Entry</em>' reference isn't clear, | ||
29 | * there really should be more of a description here... | ||
30 | * </p> | ||
31 | * <!-- end-user-doc --> | ||
32 | * @return the value of the '<em>Entry</em>' reference. | ||
33 | * @see #setEntry(State) | ||
34 | * @see simpleStatechart.SimpleStatechartPackage#getEntry_Entry() | ||
35 | * @model | ||
36 | * @generated | ||
37 | */ | ||
38 | State getEntry(); | ||
39 | |||
40 | /** | ||
41 | * Sets the value of the '{@link simpleStatechart.Entry#getEntry <em>Entry</em>}' reference. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @param value the new value of the '<em>Entry</em>' reference. | ||
45 | * @see #getEntry() | ||
46 | * @generated | ||
47 | */ | ||
48 | void setEntry(State value); | ||
49 | |||
50 | } // Entry | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/SimpleStatechartFactory.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/SimpleStatechartFactory.java new file mode 100644 index 00000000..a185daa0 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/SimpleStatechartFactory.java | |||
@@ -0,0 +1,60 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EFactory; | ||
6 | |||
7 | /** | ||
8 | * <!-- begin-user-doc --> | ||
9 | * The <b>Factory</b> for the model. | ||
10 | * It provides a create method for each non-abstract class of the model. | ||
11 | * <!-- end-user-doc --> | ||
12 | * @see simpleStatechart.SimpleStatechartPackage | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface SimpleStatechartFactory extends EFactory { | ||
16 | /** | ||
17 | * The singleton instance of the factory. | ||
18 | * <!-- begin-user-doc --> | ||
19 | * <!-- end-user-doc --> | ||
20 | * @generated | ||
21 | */ | ||
22 | SimpleStatechartFactory eINSTANCE = simpleStatechart.impl.SimpleStatechartFactoryImpl.init(); | ||
23 | |||
24 | /** | ||
25 | * Returns a new object of class '<em>State</em>'. | ||
26 | * <!-- begin-user-doc --> | ||
27 | * <!-- end-user-doc --> | ||
28 | * @return a new object of class '<em>State</em>'. | ||
29 | * @generated | ||
30 | */ | ||
31 | State createState(); | ||
32 | |||
33 | /** | ||
34 | * Returns a new object of class '<em>Entry</em>'. | ||
35 | * <!-- begin-user-doc --> | ||
36 | * <!-- end-user-doc --> | ||
37 | * @return a new object of class '<em>Entry</em>'. | ||
38 | * @generated | ||
39 | */ | ||
40 | Entry createEntry(); | ||
41 | |||
42 | /** | ||
43 | * Returns a new object of class '<em>Statechart</em>'. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @return a new object of class '<em>Statechart</em>'. | ||
47 | * @generated | ||
48 | */ | ||
49 | Statechart createStatechart(); | ||
50 | |||
51 | /** | ||
52 | * Returns the package supported by this factory. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @return the package supported by this factory. | ||
56 | * @generated | ||
57 | */ | ||
58 | SimpleStatechartPackage getSimpleStatechartPackage(); | ||
59 | |||
60 | } //SimpleStatechartFactory | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/SimpleStatechartPackage.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/SimpleStatechartPackage.java new file mode 100644 index 00000000..0d5a1042 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/SimpleStatechartPackage.java | |||
@@ -0,0 +1,340 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | import org.eclipse.emf.ecore.EReference; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * The <b>Package</b> for the model. | ||
12 | * It contains accessors for the meta objects to represent | ||
13 | * <ul> | ||
14 | * <li>each class,</li> | ||
15 | * <li>each feature of each class,</li> | ||
16 | * <li>each operation of each class,</li> | ||
17 | * <li>each enum,</li> | ||
18 | * <li>and each data type</li> | ||
19 | * </ul> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @see simpleStatechart.SimpleStatechartFactory | ||
22 | * @model kind="package" | ||
23 | * @generated | ||
24 | */ | ||
25 | public interface SimpleStatechartPackage extends EPackage { | ||
26 | /** | ||
27 | * The package name. | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | String eNAME = "simpleStatechart"; | ||
33 | |||
34 | /** | ||
35 | * The package namespace URI. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | String eNS_URI = "simpleSC"; | ||
41 | |||
42 | /** | ||
43 | * The package namespace name. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @generated | ||
47 | */ | ||
48 | String eNS_PREFIX = "simpleSC"; | ||
49 | |||
50 | /** | ||
51 | * The singleton instance of the package. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | SimpleStatechartPackage eINSTANCE = simpleStatechart.impl.SimpleStatechartPackageImpl.init(); | ||
57 | |||
58 | /** | ||
59 | * The meta object id for the '{@link simpleStatechart.impl.StateImpl <em>State</em>}' class. | ||
60 | * <!-- begin-user-doc --> | ||
61 | * <!-- end-user-doc --> | ||
62 | * @see simpleStatechart.impl.StateImpl | ||
63 | * @see simpleStatechart.impl.SimpleStatechartPackageImpl#getState() | ||
64 | * @generated | ||
65 | */ | ||
66 | int STATE = 0; | ||
67 | |||
68 | /** | ||
69 | * The feature id for the '<em><b>Next</b></em>' reference list. | ||
70 | * <!-- begin-user-doc --> | ||
71 | * <!-- end-user-doc --> | ||
72 | * @generated | ||
73 | * @ordered | ||
74 | */ | ||
75 | int STATE__NEXT = 0; | ||
76 | |||
77 | /** | ||
78 | * The number of structural features of the '<em>State</em>' class. | ||
79 | * <!-- begin-user-doc --> | ||
80 | * <!-- end-user-doc --> | ||
81 | * @generated | ||
82 | * @ordered | ||
83 | */ | ||
84 | int STATE_FEATURE_COUNT = 1; | ||
85 | |||
86 | /** | ||
87 | * The number of operations of the '<em>State</em>' class. | ||
88 | * <!-- begin-user-doc --> | ||
89 | * <!-- end-user-doc --> | ||
90 | * @generated | ||
91 | * @ordered | ||
92 | */ | ||
93 | int STATE_OPERATION_COUNT = 0; | ||
94 | |||
95 | /** | ||
96 | * The meta object id for the '{@link simpleStatechart.impl.EntryImpl <em>Entry</em>}' class. | ||
97 | * <!-- begin-user-doc --> | ||
98 | * <!-- end-user-doc --> | ||
99 | * @see simpleStatechart.impl.EntryImpl | ||
100 | * @see simpleStatechart.impl.SimpleStatechartPackageImpl#getEntry() | ||
101 | * @generated | ||
102 | */ | ||
103 | int ENTRY = 1; | ||
104 | |||
105 | /** | ||
106 | * The feature id for the '<em><b>Entry</b></em>' reference. | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @generated | ||
110 | * @ordered | ||
111 | */ | ||
112 | int ENTRY__ENTRY = 0; | ||
113 | |||
114 | /** | ||
115 | * The number of structural features of the '<em>Entry</em>' class. | ||
116 | * <!-- begin-user-doc --> | ||
117 | * <!-- end-user-doc --> | ||
118 | * @generated | ||
119 | * @ordered | ||
120 | */ | ||
121 | int ENTRY_FEATURE_COUNT = 1; | ||
122 | |||
123 | /** | ||
124 | * The number of operations of the '<em>Entry</em>' class. | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | * @ordered | ||
129 | */ | ||
130 | int ENTRY_OPERATION_COUNT = 0; | ||
131 | |||
132 | /** | ||
133 | * The meta object id for the '{@link simpleStatechart.impl.StatechartImpl <em>Statechart</em>}' class. | ||
134 | * <!-- begin-user-doc --> | ||
135 | * <!-- end-user-doc --> | ||
136 | * @see simpleStatechart.impl.StatechartImpl | ||
137 | * @see simpleStatechart.impl.SimpleStatechartPackageImpl#getStatechart() | ||
138 | * @generated | ||
139 | */ | ||
140 | int STATECHART = 2; | ||
141 | |||
142 | /** | ||
143 | * The feature id for the '<em><b>State</b></em>' containment reference list. | ||
144 | * <!-- begin-user-doc --> | ||
145 | * <!-- end-user-doc --> | ||
146 | * @generated | ||
147 | * @ordered | ||
148 | */ | ||
149 | int STATECHART__STATE = 0; | ||
150 | |||
151 | /** | ||
152 | * The feature id for the '<em><b>Entry</b></em>' containment reference. | ||
153 | * <!-- begin-user-doc --> | ||
154 | * <!-- end-user-doc --> | ||
155 | * @generated | ||
156 | * @ordered | ||
157 | */ | ||
158 | int STATECHART__ENTRY = 1; | ||
159 | |||
160 | /** | ||
161 | * The number of structural features of the '<em>Statechart</em>' class. | ||
162 | * <!-- begin-user-doc --> | ||
163 | * <!-- end-user-doc --> | ||
164 | * @generated | ||
165 | * @ordered | ||
166 | */ | ||
167 | int STATECHART_FEATURE_COUNT = 2; | ||
168 | |||
169 | /** | ||
170 | * The number of operations of the '<em>Statechart</em>' class. | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | * @ordered | ||
175 | */ | ||
176 | int STATECHART_OPERATION_COUNT = 0; | ||
177 | |||
178 | |||
179 | /** | ||
180 | * Returns the meta object for class '{@link simpleStatechart.State <em>State</em>}'. | ||
181 | * <!-- begin-user-doc --> | ||
182 | * <!-- end-user-doc --> | ||
183 | * @return the meta object for class '<em>State</em>'. | ||
184 | * @see simpleStatechart.State | ||
185 | * @generated | ||
186 | */ | ||
187 | EClass getState(); | ||
188 | |||
189 | /** | ||
190 | * Returns the meta object for the reference list '{@link simpleStatechart.State#getNext <em>Next</em>}'. | ||
191 | * <!-- begin-user-doc --> | ||
192 | * <!-- end-user-doc --> | ||
193 | * @return the meta object for the reference list '<em>Next</em>'. | ||
194 | * @see simpleStatechart.State#getNext() | ||
195 | * @see #getState() | ||
196 | * @generated | ||
197 | */ | ||
198 | EReference getState_Next(); | ||
199 | |||
200 | /** | ||
201 | * Returns the meta object for class '{@link simpleStatechart.Entry <em>Entry</em>}'. | ||
202 | * <!-- begin-user-doc --> | ||
203 | * <!-- end-user-doc --> | ||
204 | * @return the meta object for class '<em>Entry</em>'. | ||
205 | * @see simpleStatechart.Entry | ||
206 | * @generated | ||
207 | */ | ||
208 | EClass getEntry(); | ||
209 | |||
210 | /** | ||
211 | * Returns the meta object for the reference '{@link simpleStatechart.Entry#getEntry <em>Entry</em>}'. | ||
212 | * <!-- begin-user-doc --> | ||
213 | * <!-- end-user-doc --> | ||
214 | * @return the meta object for the reference '<em>Entry</em>'. | ||
215 | * @see simpleStatechart.Entry#getEntry() | ||
216 | * @see #getEntry() | ||
217 | * @generated | ||
218 | */ | ||
219 | EReference getEntry_Entry(); | ||
220 | |||
221 | /** | ||
222 | * Returns the meta object for class '{@link simpleStatechart.Statechart <em>Statechart</em>}'. | ||
223 | * <!-- begin-user-doc --> | ||
224 | * <!-- end-user-doc --> | ||
225 | * @return the meta object for class '<em>Statechart</em>'. | ||
226 | * @see simpleStatechart.Statechart | ||
227 | * @generated | ||
228 | */ | ||
229 | EClass getStatechart(); | ||
230 | |||
231 | /** | ||
232 | * Returns the meta object for the containment reference list '{@link simpleStatechart.Statechart#getState <em>State</em>}'. | ||
233 | * <!-- begin-user-doc --> | ||
234 | * <!-- end-user-doc --> | ||
235 | * @return the meta object for the containment reference list '<em>State</em>'. | ||
236 | * @see simpleStatechart.Statechart#getState() | ||
237 | * @see #getStatechart() | ||
238 | * @generated | ||
239 | */ | ||
240 | EReference getStatechart_State(); | ||
241 | |||
242 | /** | ||
243 | * Returns the meta object for the containment reference '{@link simpleStatechart.Statechart#getEntry <em>Entry</em>}'. | ||
244 | * <!-- begin-user-doc --> | ||
245 | * <!-- end-user-doc --> | ||
246 | * @return the meta object for the containment reference '<em>Entry</em>'. | ||
247 | * @see simpleStatechart.Statechart#getEntry() | ||
248 | * @see #getStatechart() | ||
249 | * @generated | ||
250 | */ | ||
251 | EReference getStatechart_Entry(); | ||
252 | |||
253 | /** | ||
254 | * Returns the factory that creates the instances of the model. | ||
255 | * <!-- begin-user-doc --> | ||
256 | * <!-- end-user-doc --> | ||
257 | * @return the factory that creates the instances of the model. | ||
258 | * @generated | ||
259 | */ | ||
260 | SimpleStatechartFactory getSimpleStatechartFactory(); | ||
261 | |||
262 | /** | ||
263 | * <!-- begin-user-doc --> | ||
264 | * Defines literals for the meta objects that represent | ||
265 | * <ul> | ||
266 | * <li>each class,</li> | ||
267 | * <li>each feature of each class,</li> | ||
268 | * <li>each operation of each class,</li> | ||
269 | * <li>each enum,</li> | ||
270 | * <li>and each data type</li> | ||
271 | * </ul> | ||
272 | * <!-- end-user-doc --> | ||
273 | * @generated | ||
274 | */ | ||
275 | interface Literals { | ||
276 | /** | ||
277 | * The meta object literal for the '{@link simpleStatechart.impl.StateImpl <em>State</em>}' class. | ||
278 | * <!-- begin-user-doc --> | ||
279 | * <!-- end-user-doc --> | ||
280 | * @see simpleStatechart.impl.StateImpl | ||
281 | * @see simpleStatechart.impl.SimpleStatechartPackageImpl#getState() | ||
282 | * @generated | ||
283 | */ | ||
284 | EClass STATE = eINSTANCE.getState(); | ||
285 | |||
286 | /** | ||
287 | * The meta object literal for the '<em><b>Next</b></em>' reference list feature. | ||
288 | * <!-- begin-user-doc --> | ||
289 | * <!-- end-user-doc --> | ||
290 | * @generated | ||
291 | */ | ||
292 | EReference STATE__NEXT = eINSTANCE.getState_Next(); | ||
293 | |||
294 | /** | ||
295 | * The meta object literal for the '{@link simpleStatechart.impl.EntryImpl <em>Entry</em>}' class. | ||
296 | * <!-- begin-user-doc --> | ||
297 | * <!-- end-user-doc --> | ||
298 | * @see simpleStatechart.impl.EntryImpl | ||
299 | * @see simpleStatechart.impl.SimpleStatechartPackageImpl#getEntry() | ||
300 | * @generated | ||
301 | */ | ||
302 | EClass ENTRY = eINSTANCE.getEntry(); | ||
303 | |||
304 | /** | ||
305 | * The meta object literal for the '<em><b>Entry</b></em>' reference feature. | ||
306 | * <!-- begin-user-doc --> | ||
307 | * <!-- end-user-doc --> | ||
308 | * @generated | ||
309 | */ | ||
310 | EReference ENTRY__ENTRY = eINSTANCE.getEntry_Entry(); | ||
311 | |||
312 | /** | ||
313 | * The meta object literal for the '{@link simpleStatechart.impl.StatechartImpl <em>Statechart</em>}' class. | ||
314 | * <!-- begin-user-doc --> | ||
315 | * <!-- end-user-doc --> | ||
316 | * @see simpleStatechart.impl.StatechartImpl | ||
317 | * @see simpleStatechart.impl.SimpleStatechartPackageImpl#getStatechart() | ||
318 | * @generated | ||
319 | */ | ||
320 | EClass STATECHART = eINSTANCE.getStatechart(); | ||
321 | |||
322 | /** | ||
323 | * The meta object literal for the '<em><b>State</b></em>' containment reference list feature. | ||
324 | * <!-- begin-user-doc --> | ||
325 | * <!-- end-user-doc --> | ||
326 | * @generated | ||
327 | */ | ||
328 | EReference STATECHART__STATE = eINSTANCE.getStatechart_State(); | ||
329 | |||
330 | /** | ||
331 | * The meta object literal for the '<em><b>Entry</b></em>' containment reference feature. | ||
332 | * <!-- begin-user-doc --> | ||
333 | * <!-- end-user-doc --> | ||
334 | * @generated | ||
335 | */ | ||
336 | EReference STATECHART__ENTRY = eINSTANCE.getStatechart_Entry(); | ||
337 | |||
338 | } | ||
339 | |||
340 | } //SimpleStatechartPackage | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/State.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/State.java new file mode 100644 index 00000000..9f65b62b --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/State.java | |||
@@ -0,0 +1,42 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>State</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link simpleStatechart.State#getNext <em>Next</em>}</li> | ||
19 | * </ul> | ||
20 | * | ||
21 | * @see simpleStatechart.SimpleStatechartPackage#getState() | ||
22 | * @model | ||
23 | * @generated | ||
24 | */ | ||
25 | public interface State extends EObject { | ||
26 | /** | ||
27 | * Returns the value of the '<em><b>Next</b></em>' reference list. | ||
28 | * The list contents are of type {@link simpleStatechart.State}. | ||
29 | * <!-- begin-user-doc --> | ||
30 | * <p> | ||
31 | * If the meaning of the '<em>Next</em>' reference list isn't clear, | ||
32 | * there really should be more of a description here... | ||
33 | * </p> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @return the value of the '<em>Next</em>' reference list. | ||
36 | * @see simpleStatechart.SimpleStatechartPackage#getState_Next() | ||
37 | * @model | ||
38 | * @generated | ||
39 | */ | ||
40 | EList<State> getNext(); | ||
41 | |||
42 | } // State | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/Statechart.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/Statechart.java new file mode 100644 index 00000000..10c6dfc1 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/Statechart.java | |||
@@ -0,0 +1,69 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>Statechart</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link simpleStatechart.Statechart#getState <em>State</em>}</li> | ||
19 | * <li>{@link simpleStatechart.Statechart#getEntry <em>Entry</em>}</li> | ||
20 | * </ul> | ||
21 | * | ||
22 | * @see simpleStatechart.SimpleStatechartPackage#getStatechart() | ||
23 | * @model | ||
24 | * @generated | ||
25 | */ | ||
26 | public interface Statechart extends EObject { | ||
27 | /** | ||
28 | * Returns the value of the '<em><b>State</b></em>' containment reference list. | ||
29 | * The list contents are of type {@link simpleStatechart.State}. | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <p> | ||
32 | * If the meaning of the '<em>State</em>' containment reference list isn't clear, | ||
33 | * there really should be more of a description here... | ||
34 | * </p> | ||
35 | * <!-- end-user-doc --> | ||
36 | * @return the value of the '<em>State</em>' containment reference list. | ||
37 | * @see simpleStatechart.SimpleStatechartPackage#getStatechart_State() | ||
38 | * @model containment="true" | ||
39 | * @generated | ||
40 | */ | ||
41 | EList<State> getState(); | ||
42 | |||
43 | /** | ||
44 | * Returns the value of the '<em><b>Entry</b></em>' containment reference. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * <p> | ||
47 | * If the meaning of the '<em>Entry</em>' containment reference isn't clear, | ||
48 | * there really should be more of a description here... | ||
49 | * </p> | ||
50 | * <!-- end-user-doc --> | ||
51 | * @return the value of the '<em>Entry</em>' containment reference. | ||
52 | * @see #setEntry(Entry) | ||
53 | * @see simpleStatechart.SimpleStatechartPackage#getStatechart_Entry() | ||
54 | * @model containment="true" required="true" | ||
55 | * @generated | ||
56 | */ | ||
57 | Entry getEntry(); | ||
58 | |||
59 | /** | ||
60 | * Sets the value of the '{@link simpleStatechart.Statechart#getEntry <em>Entry</em>}' containment reference. | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @param value the new value of the '<em>Entry</em>' containment reference. | ||
64 | * @see #getEntry() | ||
65 | * @generated | ||
66 | */ | ||
67 | void setEntry(Entry value); | ||
68 | |||
69 | } // Statechart | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/EntryImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/EntryImpl.java new file mode 100644 index 00000000..0e25ace3 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/EntryImpl.java | |||
@@ -0,0 +1,157 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart.impl; | ||
4 | |||
5 | import org.eclipse.emf.common.notify.Notification; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EClass; | ||
8 | import org.eclipse.emf.ecore.InternalEObject; | ||
9 | |||
10 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
11 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
12 | |||
13 | import simpleStatechart.Entry; | ||
14 | import simpleStatechart.SimpleStatechartPackage; | ||
15 | import simpleStatechart.State; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model object '<em><b>Entry</b></em>'. | ||
20 | * <!-- end-user-doc --> | ||
21 | * <p> | ||
22 | * The following features are implemented: | ||
23 | * </p> | ||
24 | * <ul> | ||
25 | * <li>{@link simpleStatechart.impl.EntryImpl#getEntry <em>Entry</em>}</li> | ||
26 | * </ul> | ||
27 | * | ||
28 | * @generated | ||
29 | */ | ||
30 | public class EntryImpl extends MinimalEObjectImpl.Container implements Entry { | ||
31 | /** | ||
32 | * The cached value of the '{@link #getEntry() <em>Entry</em>}' reference. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @see #getEntry() | ||
36 | * @generated | ||
37 | * @ordered | ||
38 | */ | ||
39 | protected State entry; | ||
40 | |||
41 | /** | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @generated | ||
45 | */ | ||
46 | protected EntryImpl() { | ||
47 | super(); | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * <!-- begin-user-doc --> | ||
52 | * <!-- end-user-doc --> | ||
53 | * @generated | ||
54 | */ | ||
55 | @Override | ||
56 | protected EClass eStaticClass() { | ||
57 | return SimpleStatechartPackage.Literals.ENTRY; | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @generated | ||
64 | */ | ||
65 | public State getEntry() { | ||
66 | if (entry != null && entry.eIsProxy()) { | ||
67 | InternalEObject oldEntry = (InternalEObject)entry; | ||
68 | entry = (State)eResolveProxy(oldEntry); | ||
69 | if (entry != oldEntry) { | ||
70 | if (eNotificationRequired()) | ||
71 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, SimpleStatechartPackage.ENTRY__ENTRY, oldEntry, entry)); | ||
72 | } | ||
73 | } | ||
74 | return entry; | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @generated | ||
81 | */ | ||
82 | public State basicGetEntry() { | ||
83 | return entry; | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | * <!-- begin-user-doc --> | ||
88 | * <!-- end-user-doc --> | ||
89 | * @generated | ||
90 | */ | ||
91 | public void setEntry(State newEntry) { | ||
92 | State oldEntry = entry; | ||
93 | entry = newEntry; | ||
94 | if (eNotificationRequired()) | ||
95 | eNotify(new ENotificationImpl(this, Notification.SET, SimpleStatechartPackage.ENTRY__ENTRY, oldEntry, entry)); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | */ | ||
103 | @Override | ||
104 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
105 | switch (featureID) { | ||
106 | case SimpleStatechartPackage.ENTRY__ENTRY: | ||
107 | if (resolve) return getEntry(); | ||
108 | return basicGetEntry(); | ||
109 | } | ||
110 | return super.eGet(featureID, resolve, coreType); | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * <!-- begin-user-doc --> | ||
115 | * <!-- end-user-doc --> | ||
116 | * @generated | ||
117 | */ | ||
118 | @Override | ||
119 | public void eSet(int featureID, Object newValue) { | ||
120 | switch (featureID) { | ||
121 | case SimpleStatechartPackage.ENTRY__ENTRY: | ||
122 | setEntry((State)newValue); | ||
123 | return; | ||
124 | } | ||
125 | super.eSet(featureID, newValue); | ||
126 | } | ||
127 | |||
128 | /** | ||
129 | * <!-- begin-user-doc --> | ||
130 | * <!-- end-user-doc --> | ||
131 | * @generated | ||
132 | */ | ||
133 | @Override | ||
134 | public void eUnset(int featureID) { | ||
135 | switch (featureID) { | ||
136 | case SimpleStatechartPackage.ENTRY__ENTRY: | ||
137 | setEntry((State)null); | ||
138 | return; | ||
139 | } | ||
140 | super.eUnset(featureID); | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * <!-- begin-user-doc --> | ||
145 | * <!-- end-user-doc --> | ||
146 | * @generated | ||
147 | */ | ||
148 | @Override | ||
149 | public boolean eIsSet(int featureID) { | ||
150 | switch (featureID) { | ||
151 | case SimpleStatechartPackage.ENTRY__ENTRY: | ||
152 | return entry != null; | ||
153 | } | ||
154 | return super.eIsSet(featureID); | ||
155 | } | ||
156 | |||
157 | } //EntryImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/SimpleStatechartFactoryImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/SimpleStatechartFactoryImpl.java new file mode 100644 index 00000000..421aee1c --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/SimpleStatechartFactoryImpl.java | |||
@@ -0,0 +1,117 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EObject; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | |||
9 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
10 | |||
11 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
12 | |||
13 | import simpleStatechart.*; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Factory</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class SimpleStatechartFactoryImpl extends EFactoryImpl implements SimpleStatechartFactory { | ||
22 | /** | ||
23 | * Creates the default factory implementation. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @generated | ||
27 | */ | ||
28 | public static SimpleStatechartFactory init() { | ||
29 | try { | ||
30 | SimpleStatechartFactory theSimpleStatechartFactory = (SimpleStatechartFactory)EPackage.Registry.INSTANCE.getEFactory(SimpleStatechartPackage.eNS_URI); | ||
31 | if (theSimpleStatechartFactory != null) { | ||
32 | return theSimpleStatechartFactory; | ||
33 | } | ||
34 | } | ||
35 | catch (Exception exception) { | ||
36 | EcorePlugin.INSTANCE.log(exception); | ||
37 | } | ||
38 | return new SimpleStatechartFactoryImpl(); | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * Creates an instance of the factory. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | public SimpleStatechartFactoryImpl() { | ||
48 | super(); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | public EObject create(EClass eClass) { | ||
58 | switch (eClass.getClassifierID()) { | ||
59 | case SimpleStatechartPackage.STATE: return createState(); | ||
60 | case SimpleStatechartPackage.ENTRY: return createEntry(); | ||
61 | case SimpleStatechartPackage.STATECHART: return createStatechart(); | ||
62 | default: | ||
63 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
64 | } | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * <!-- begin-user-doc --> | ||
69 | * <!-- end-user-doc --> | ||
70 | * @generated | ||
71 | */ | ||
72 | public State createState() { | ||
73 | StateImpl state = new StateImpl(); | ||
74 | return state; | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @generated | ||
81 | */ | ||
82 | public Entry createEntry() { | ||
83 | EntryImpl entry = new EntryImpl(); | ||
84 | return entry; | ||
85 | } | ||
86 | |||
87 | /** | ||
88 | * <!-- begin-user-doc --> | ||
89 | * <!-- end-user-doc --> | ||
90 | * @generated | ||
91 | */ | ||
92 | public Statechart createStatechart() { | ||
93 | StatechartImpl statechart = new StatechartImpl(); | ||
94 | return statechart; | ||
95 | } | ||
96 | |||
97 | /** | ||
98 | * <!-- begin-user-doc --> | ||
99 | * <!-- end-user-doc --> | ||
100 | * @generated | ||
101 | */ | ||
102 | public SimpleStatechartPackage getSimpleStatechartPackage() { | ||
103 | return (SimpleStatechartPackage)getEPackage(); | ||
104 | } | ||
105 | |||
106 | /** | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @deprecated | ||
110 | * @generated | ||
111 | */ | ||
112 | @Deprecated | ||
113 | public static SimpleStatechartPackage getPackage() { | ||
114 | return SimpleStatechartPackage.eINSTANCE; | ||
115 | } | ||
116 | |||
117 | } //SimpleStatechartFactoryImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/SimpleStatechartPackageImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/SimpleStatechartPackageImpl.java new file mode 100644 index 00000000..556157e4 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/SimpleStatechartPackageImpl.java | |||
@@ -0,0 +1,252 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | import org.eclipse.emf.ecore.EReference; | ||
8 | |||
9 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
10 | |||
11 | import simpleStatechart.Entry; | ||
12 | import simpleStatechart.SimpleStatechartFactory; | ||
13 | import simpleStatechart.SimpleStatechartPackage; | ||
14 | import simpleStatechart.State; | ||
15 | import simpleStatechart.Statechart; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model <b>Package</b>. | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | public class SimpleStatechartPackageImpl extends EPackageImpl implements SimpleStatechartPackage { | ||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | private EClass stateEClass = null; | ||
30 | |||
31 | /** | ||
32 | * <!-- begin-user-doc --> | ||
33 | * <!-- end-user-doc --> | ||
34 | * @generated | ||
35 | */ | ||
36 | private EClass entryEClass = null; | ||
37 | |||
38 | /** | ||
39 | * <!-- begin-user-doc --> | ||
40 | * <!-- end-user-doc --> | ||
41 | * @generated | ||
42 | */ | ||
43 | private EClass statechartEClass = null; | ||
44 | |||
45 | /** | ||
46 | * Creates an instance of the model <b>Package</b>, registered with | ||
47 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
48 | * package URI value. | ||
49 | * <p>Note: the correct way to create the package is via the static | ||
50 | * factory method {@link #init init()}, which also performs | ||
51 | * initialization of the package, or returns the registered package, | ||
52 | * if one already exists. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
56 | * @see simpleStatechart.SimpleStatechartPackage#eNS_URI | ||
57 | * @see #init() | ||
58 | * @generated | ||
59 | */ | ||
60 | private SimpleStatechartPackageImpl() { | ||
61 | super(eNS_URI, SimpleStatechartFactory.eINSTANCE); | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * <!-- begin-user-doc --> | ||
66 | * <!-- end-user-doc --> | ||
67 | * @generated | ||
68 | */ | ||
69 | private static boolean isInited = false; | ||
70 | |||
71 | /** | ||
72 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
73 | * | ||
74 | * <p>This method is used to initialize {@link SimpleStatechartPackage#eINSTANCE} when that field is accessed. | ||
75 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
76 | * <!-- begin-user-doc --> | ||
77 | * <!-- end-user-doc --> | ||
78 | * @see #eNS_URI | ||
79 | * @see #createPackageContents() | ||
80 | * @see #initializePackageContents() | ||
81 | * @generated | ||
82 | */ | ||
83 | public static SimpleStatechartPackage init() { | ||
84 | if (isInited) return (SimpleStatechartPackage)EPackage.Registry.INSTANCE.getEPackage(SimpleStatechartPackage.eNS_URI); | ||
85 | |||
86 | // Obtain or create and register package | ||
87 | Object registeredSimpleStatechartPackage = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
88 | SimpleStatechartPackageImpl theSimpleStatechartPackage = registeredSimpleStatechartPackage instanceof SimpleStatechartPackageImpl ? (SimpleStatechartPackageImpl)registeredSimpleStatechartPackage : new SimpleStatechartPackageImpl(); | ||
89 | |||
90 | isInited = true; | ||
91 | |||
92 | // Create package meta-data objects | ||
93 | theSimpleStatechartPackage.createPackageContents(); | ||
94 | |||
95 | // Initialize created meta-data | ||
96 | theSimpleStatechartPackage.initializePackageContents(); | ||
97 | |||
98 | // Mark meta-data to indicate it can't be changed | ||
99 | theSimpleStatechartPackage.freeze(); | ||
100 | |||
101 | // Update the registry and return the package | ||
102 | EPackage.Registry.INSTANCE.put(SimpleStatechartPackage.eNS_URI, theSimpleStatechartPackage); | ||
103 | return theSimpleStatechartPackage; | ||
104 | } | ||
105 | |||
106 | /** | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @generated | ||
110 | */ | ||
111 | public EClass getState() { | ||
112 | return stateEClass; | ||
113 | } | ||
114 | |||
115 | /** | ||
116 | * <!-- begin-user-doc --> | ||
117 | * <!-- end-user-doc --> | ||
118 | * @generated | ||
119 | */ | ||
120 | public EReference getState_Next() { | ||
121 | return (EReference)stateEClass.getEStructuralFeatures().get(0); | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | */ | ||
129 | public EClass getEntry() { | ||
130 | return entryEClass; | ||
131 | } | ||
132 | |||
133 | /** | ||
134 | * <!-- begin-user-doc --> | ||
135 | * <!-- end-user-doc --> | ||
136 | * @generated | ||
137 | */ | ||
138 | public EReference getEntry_Entry() { | ||
139 | return (EReference)entryEClass.getEStructuralFeatures().get(0); | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * <!-- begin-user-doc --> | ||
144 | * <!-- end-user-doc --> | ||
145 | * @generated | ||
146 | */ | ||
147 | public EClass getStatechart() { | ||
148 | return statechartEClass; | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | public EReference getStatechart_State() { | ||
157 | return (EReference)statechartEClass.getEStructuralFeatures().get(0); | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * <!-- begin-user-doc --> | ||
162 | * <!-- end-user-doc --> | ||
163 | * @generated | ||
164 | */ | ||
165 | public EReference getStatechart_Entry() { | ||
166 | return (EReference)statechartEClass.getEStructuralFeatures().get(1); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * <!-- begin-user-doc --> | ||
171 | * <!-- end-user-doc --> | ||
172 | * @generated | ||
173 | */ | ||
174 | public SimpleStatechartFactory getSimpleStatechartFactory() { | ||
175 | return (SimpleStatechartFactory)getEFactoryInstance(); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * <!-- begin-user-doc --> | ||
180 | * <!-- end-user-doc --> | ||
181 | * @generated | ||
182 | */ | ||
183 | private boolean isCreated = false; | ||
184 | |||
185 | /** | ||
186 | * Creates the meta-model objects for the package. This method is | ||
187 | * guarded to have no affect on any invocation but its first. | ||
188 | * <!-- begin-user-doc --> | ||
189 | * <!-- end-user-doc --> | ||
190 | * @generated | ||
191 | */ | ||
192 | public void createPackageContents() { | ||
193 | if (isCreated) return; | ||
194 | isCreated = true; | ||
195 | |||
196 | // Create classes and their features | ||
197 | stateEClass = createEClass(STATE); | ||
198 | createEReference(stateEClass, STATE__NEXT); | ||
199 | |||
200 | entryEClass = createEClass(ENTRY); | ||
201 | createEReference(entryEClass, ENTRY__ENTRY); | ||
202 | |||
203 | statechartEClass = createEClass(STATECHART); | ||
204 | createEReference(statechartEClass, STATECHART__STATE); | ||
205 | createEReference(statechartEClass, STATECHART__ENTRY); | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * <!-- begin-user-doc --> | ||
210 | * <!-- end-user-doc --> | ||
211 | * @generated | ||
212 | */ | ||
213 | private boolean isInitialized = false; | ||
214 | |||
215 | /** | ||
216 | * Complete the initialization of the package and its meta-model. This | ||
217 | * method is guarded to have no affect on any invocation but its first. | ||
218 | * <!-- begin-user-doc --> | ||
219 | * <!-- end-user-doc --> | ||
220 | * @generated | ||
221 | */ | ||
222 | public void initializePackageContents() { | ||
223 | if (isInitialized) return; | ||
224 | isInitialized = true; | ||
225 | |||
226 | // Initialize package | ||
227 | setName(eNAME); | ||
228 | setNsPrefix(eNS_PREFIX); | ||
229 | setNsURI(eNS_URI); | ||
230 | |||
231 | // Create type parameters | ||
232 | |||
233 | // Set bounds for type parameters | ||
234 | |||
235 | // Add supertypes to classes | ||
236 | |||
237 | // Initialize classes, features, and operations; add parameters | ||
238 | initEClass(stateEClass, State.class, "State", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
239 | initEReference(getState_Next(), this.getState(), null, "next", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
240 | |||
241 | initEClass(entryEClass, Entry.class, "Entry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
242 | initEReference(getEntry_Entry(), this.getState(), null, "entry", null, 0, 1, Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
243 | |||
244 | initEClass(statechartEClass, Statechart.class, "Statechart", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
245 | initEReference(getStatechart_State(), this.getState(), null, "state", null, 0, -1, Statechart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
246 | initEReference(getStatechart_Entry(), this.getEntry(), null, "entry", null, 1, 1, Statechart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
247 | |||
248 | // Create resource | ||
249 | createResource(eNS_URI); | ||
250 | } | ||
251 | |||
252 | } //SimpleStatechartPackageImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StateImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StateImpl.java new file mode 100644 index 00000000..52b97a9d --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StateImpl.java | |||
@@ -0,0 +1,133 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.util.EList; | ||
8 | |||
9 | import org.eclipse.emf.ecore.EClass; | ||
10 | |||
11 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
12 | |||
13 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; | ||
14 | |||
15 | import simpleStatechart.SimpleStatechartPackage; | ||
16 | import simpleStatechart.State; | ||
17 | |||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * An implementation of the model object '<em><b>State</b></em>'. | ||
21 | * <!-- end-user-doc --> | ||
22 | * <p> | ||
23 | * The following features are implemented: | ||
24 | * </p> | ||
25 | * <ul> | ||
26 | * <li>{@link simpleStatechart.impl.StateImpl#getNext <em>Next</em>}</li> | ||
27 | * </ul> | ||
28 | * | ||
29 | * @generated | ||
30 | */ | ||
31 | public class StateImpl extends MinimalEObjectImpl.Container implements State { | ||
32 | /** | ||
33 | * The cached value of the '{@link #getNext() <em>Next</em>}' reference list. | ||
34 | * <!-- begin-user-doc --> | ||
35 | * <!-- end-user-doc --> | ||
36 | * @see #getNext() | ||
37 | * @generated | ||
38 | * @ordered | ||
39 | */ | ||
40 | protected EList<State> next; | ||
41 | |||
42 | /** | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | protected StateImpl() { | ||
48 | super(); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | protected EClass eStaticClass() { | ||
58 | return SimpleStatechartPackage.Literals.STATE; | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | public EList<State> getNext() { | ||
67 | if (next == null) { | ||
68 | next = new EObjectResolvingEList<State>(State.class, this, SimpleStatechartPackage.STATE__NEXT); | ||
69 | } | ||
70 | return next; | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * <!-- begin-user-doc --> | ||
75 | * <!-- end-user-doc --> | ||
76 | * @generated | ||
77 | */ | ||
78 | @Override | ||
79 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
80 | switch (featureID) { | ||
81 | case SimpleStatechartPackage.STATE__NEXT: | ||
82 | return getNext(); | ||
83 | } | ||
84 | return super.eGet(featureID, resolve, coreType); | ||
85 | } | ||
86 | |||
87 | /** | ||
88 | * <!-- begin-user-doc --> | ||
89 | * <!-- end-user-doc --> | ||
90 | * @generated | ||
91 | */ | ||
92 | @SuppressWarnings("unchecked") | ||
93 | @Override | ||
94 | public void eSet(int featureID, Object newValue) { | ||
95 | switch (featureID) { | ||
96 | case SimpleStatechartPackage.STATE__NEXT: | ||
97 | getNext().clear(); | ||
98 | getNext().addAll((Collection<? extends State>)newValue); | ||
99 | return; | ||
100 | } | ||
101 | super.eSet(featureID, newValue); | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * <!-- begin-user-doc --> | ||
106 | * <!-- end-user-doc --> | ||
107 | * @generated | ||
108 | */ | ||
109 | @Override | ||
110 | public void eUnset(int featureID) { | ||
111 | switch (featureID) { | ||
112 | case SimpleStatechartPackage.STATE__NEXT: | ||
113 | getNext().clear(); | ||
114 | return; | ||
115 | } | ||
116 | super.eUnset(featureID); | ||
117 | } | ||
118 | |||
119 | /** | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @generated | ||
123 | */ | ||
124 | @Override | ||
125 | public boolean eIsSet(int featureID) { | ||
126 | switch (featureID) { | ||
127 | case SimpleStatechartPackage.STATE__NEXT: | ||
128 | return next != null && !next.isEmpty(); | ||
129 | } | ||
130 | return super.eIsSet(featureID); | ||
131 | } | ||
132 | |||
133 | } //StateImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java new file mode 100644 index 00000000..cef2ee61 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java | |||
@@ -0,0 +1,221 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Notification; | ||
8 | import org.eclipse.emf.common.notify.NotificationChain; | ||
9 | |||
10 | import org.eclipse.emf.common.util.EList; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.emf.ecore.InternalEObject; | ||
14 | |||
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
16 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
17 | |||
18 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
19 | import org.eclipse.emf.ecore.util.InternalEList; | ||
20 | |||
21 | import simpleStatechart.Entry; | ||
22 | import simpleStatechart.SimpleStatechartPackage; | ||
23 | import simpleStatechart.State; | ||
24 | import simpleStatechart.Statechart; | ||
25 | |||
26 | /** | ||
27 | * <!-- begin-user-doc --> | ||
28 | * An implementation of the model object '<em><b>Statechart</b></em>'. | ||
29 | * <!-- end-user-doc --> | ||
30 | * <p> | ||
31 | * The following features are implemented: | ||
32 | * </p> | ||
33 | * <ul> | ||
34 | * <li>{@link simpleStatechart.impl.StatechartImpl#getState <em>State</em>}</li> | ||
35 | * <li>{@link simpleStatechart.impl.StatechartImpl#getEntry <em>Entry</em>}</li> | ||
36 | * </ul> | ||
37 | * | ||
38 | * @generated | ||
39 | */ | ||
40 | public class StatechartImpl extends MinimalEObjectImpl.Container implements Statechart { | ||
41 | /** | ||
42 | * The cached value of the '{@link #getState() <em>State</em>}' containment reference list. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getState() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected EList<State> state; | ||
50 | |||
51 | /** | ||
52 | * The cached value of the '{@link #getEntry() <em>Entry</em>}' containment reference. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #getEntry() | ||
56 | * @generated | ||
57 | * @ordered | ||
58 | */ | ||
59 | protected Entry entry; | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | protected StatechartImpl() { | ||
67 | super(); | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | @Override | ||
76 | protected EClass eStaticClass() { | ||
77 | return SimpleStatechartPackage.Literals.STATECHART; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | public EList<State> getState() { | ||
86 | if (state == null) { | ||
87 | state = new EObjectContainmentEList<State>(State.class, this, SimpleStatechartPackage.STATECHART__STATE); | ||
88 | } | ||
89 | return state; | ||
90 | } | ||
91 | |||
92 | /** | ||
93 | * <!-- begin-user-doc --> | ||
94 | * <!-- end-user-doc --> | ||
95 | * @generated | ||
96 | */ | ||
97 | public Entry getEntry() { | ||
98 | return entry; | ||
99 | } | ||
100 | |||
101 | /** | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @generated | ||
105 | */ | ||
106 | public NotificationChain basicSetEntry(Entry newEntry, NotificationChain msgs) { | ||
107 | Entry oldEntry = entry; | ||
108 | entry = newEntry; | ||
109 | if (eNotificationRequired()) { | ||
110 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimpleStatechartPackage.STATECHART__ENTRY, oldEntry, newEntry); | ||
111 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
112 | } | ||
113 | return msgs; | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * <!-- begin-user-doc --> | ||
118 | * <!-- end-user-doc --> | ||
119 | * @generated | ||
120 | */ | ||
121 | public void setEntry(Entry newEntry) { | ||
122 | if (newEntry != entry) { | ||
123 | NotificationChain msgs = null; | ||
124 | if (entry != null) | ||
125 | msgs = ((InternalEObject)entry).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SimpleStatechartPackage.STATECHART__ENTRY, null, msgs); | ||
126 | if (newEntry != null) | ||
127 | msgs = ((InternalEObject)newEntry).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SimpleStatechartPackage.STATECHART__ENTRY, null, msgs); | ||
128 | msgs = basicSetEntry(newEntry, msgs); | ||
129 | if (msgs != null) msgs.dispatch(); | ||
130 | } | ||
131 | else if (eNotificationRequired()) | ||
132 | eNotify(new ENotificationImpl(this, Notification.SET, SimpleStatechartPackage.STATECHART__ENTRY, newEntry, newEntry)); | ||
133 | } | ||
134 | |||
135 | /** | ||
136 | * <!-- begin-user-doc --> | ||
137 | * <!-- end-user-doc --> | ||
138 | * @generated | ||
139 | */ | ||
140 | @Override | ||
141 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
142 | switch (featureID) { | ||
143 | case SimpleStatechartPackage.STATECHART__STATE: | ||
144 | return ((InternalEList<?>)getState()).basicRemove(otherEnd, msgs); | ||
145 | case SimpleStatechartPackage.STATECHART__ENTRY: | ||
146 | return basicSetEntry(null, msgs); | ||
147 | } | ||
148 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | @Override | ||
157 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
158 | switch (featureID) { | ||
159 | case SimpleStatechartPackage.STATECHART__STATE: | ||
160 | return getState(); | ||
161 | case SimpleStatechartPackage.STATECHART__ENTRY: | ||
162 | return getEntry(); | ||
163 | } | ||
164 | return super.eGet(featureID, resolve, coreType); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * <!-- begin-user-doc --> | ||
169 | * <!-- end-user-doc --> | ||
170 | * @generated | ||
171 | */ | ||
172 | @SuppressWarnings("unchecked") | ||
173 | @Override | ||
174 | public void eSet(int featureID, Object newValue) { | ||
175 | switch (featureID) { | ||
176 | case SimpleStatechartPackage.STATECHART__STATE: | ||
177 | getState().clear(); | ||
178 | getState().addAll((Collection<? extends State>)newValue); | ||
179 | return; | ||
180 | case SimpleStatechartPackage.STATECHART__ENTRY: | ||
181 | setEntry((Entry)newValue); | ||
182 | return; | ||
183 | } | ||
184 | super.eSet(featureID, newValue); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * <!-- begin-user-doc --> | ||
189 | * <!-- end-user-doc --> | ||
190 | * @generated | ||
191 | */ | ||
192 | @Override | ||
193 | public void eUnset(int featureID) { | ||
194 | switch (featureID) { | ||
195 | case SimpleStatechartPackage.STATECHART__STATE: | ||
196 | getState().clear(); | ||
197 | return; | ||
198 | case SimpleStatechartPackage.STATECHART__ENTRY: | ||
199 | setEntry((Entry)null); | ||
200 | return; | ||
201 | } | ||
202 | super.eUnset(featureID); | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * <!-- begin-user-doc --> | ||
207 | * <!-- end-user-doc --> | ||
208 | * @generated | ||
209 | */ | ||
210 | @Override | ||
211 | public boolean eIsSet(int featureID) { | ||
212 | switch (featureID) { | ||
213 | case SimpleStatechartPackage.STATECHART__STATE: | ||
214 | return state != null && !state.isEmpty(); | ||
215 | case SimpleStatechartPackage.STATECHART__ENTRY: | ||
216 | return entry != null; | ||
217 | } | ||
218 | return super.eIsSet(featureID); | ||
219 | } | ||
220 | |||
221 | } //StatechartImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/util/SimpleStatechartAdapterFactory.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/util/SimpleStatechartAdapterFactory.java new file mode 100644 index 00000000..908a7f5f --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/util/SimpleStatechartAdapterFactory.java | |||
@@ -0,0 +1,156 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart.util; | ||
4 | |||
5 | import org.eclipse.emf.common.notify.Adapter; | ||
6 | import org.eclipse.emf.common.notify.Notifier; | ||
7 | |||
8 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; | ||
9 | |||
10 | import org.eclipse.emf.ecore.EObject; | ||
11 | |||
12 | import simpleStatechart.*; | ||
13 | |||
14 | /** | ||
15 | * <!-- begin-user-doc --> | ||
16 | * The <b>Adapter Factory</b> for the model. | ||
17 | * It provides an adapter <code>createXXX</code> method for each class of the model. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @see simpleStatechart.SimpleStatechartPackage | ||
20 | * @generated | ||
21 | */ | ||
22 | public class SimpleStatechartAdapterFactory extends AdapterFactoryImpl { | ||
23 | /** | ||
24 | * The cached model package. | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | protected static SimpleStatechartPackage modelPackage; | ||
30 | |||
31 | /** | ||
32 | * Creates an instance of the adapter factory. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @generated | ||
36 | */ | ||
37 | public SimpleStatechartAdapterFactory() { | ||
38 | if (modelPackage == null) { | ||
39 | modelPackage = SimpleStatechartPackage.eINSTANCE; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * Returns whether this factory is applicable for the type of the object. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. | ||
47 | * <!-- end-user-doc --> | ||
48 | * @return whether this factory is applicable for the type of the object. | ||
49 | * @generated | ||
50 | */ | ||
51 | @Override | ||
52 | public boolean isFactoryForType(Object object) { | ||
53 | if (object == modelPackage) { | ||
54 | return true; | ||
55 | } | ||
56 | if (object instanceof EObject) { | ||
57 | return ((EObject)object).eClass().getEPackage() == modelPackage; | ||
58 | } | ||
59 | return false; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * The switch that delegates to the <code>createXXX</code> methods. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @generated | ||
67 | */ | ||
68 | protected SimpleStatechartSwitch<Adapter> modelSwitch = | ||
69 | new SimpleStatechartSwitch<Adapter>() { | ||
70 | @Override | ||
71 | public Adapter caseState(State object) { | ||
72 | return createStateAdapter(); | ||
73 | } | ||
74 | @Override | ||
75 | public Adapter caseEntry(Entry object) { | ||
76 | return createEntryAdapter(); | ||
77 | } | ||
78 | @Override | ||
79 | public Adapter caseStatechart(Statechart object) { | ||
80 | return createStatechartAdapter(); | ||
81 | } | ||
82 | @Override | ||
83 | public Adapter defaultCase(EObject object) { | ||
84 | return createEObjectAdapter(); | ||
85 | } | ||
86 | }; | ||
87 | |||
88 | /** | ||
89 | * Creates an adapter for the <code>target</code>. | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @param target the object to adapt. | ||
93 | * @return the adapter for the <code>target</code>. | ||
94 | * @generated | ||
95 | */ | ||
96 | @Override | ||
97 | public Adapter createAdapter(Notifier target) { | ||
98 | return modelSwitch.doSwitch((EObject)target); | ||
99 | } | ||
100 | |||
101 | |||
102 | /** | ||
103 | * Creates a new adapter for an object of class '{@link simpleStatechart.State <em>State</em>}'. | ||
104 | * <!-- begin-user-doc --> | ||
105 | * This default implementation returns null so that we can easily ignore cases; | ||
106 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
107 | * <!-- end-user-doc --> | ||
108 | * @return the new adapter. | ||
109 | * @see simpleStatechart.State | ||
110 | * @generated | ||
111 | */ | ||
112 | public Adapter createStateAdapter() { | ||
113 | return null; | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * Creates a new adapter for an object of class '{@link simpleStatechart.Entry <em>Entry</em>}'. | ||
118 | * <!-- begin-user-doc --> | ||
119 | * This default implementation returns null so that we can easily ignore cases; | ||
120 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
121 | * <!-- end-user-doc --> | ||
122 | * @return the new adapter. | ||
123 | * @see simpleStatechart.Entry | ||
124 | * @generated | ||
125 | */ | ||
126 | public Adapter createEntryAdapter() { | ||
127 | return null; | ||
128 | } | ||
129 | |||
130 | /** | ||
131 | * Creates a new adapter for an object of class '{@link simpleStatechart.Statechart <em>Statechart</em>}'. | ||
132 | * <!-- begin-user-doc --> | ||
133 | * This default implementation returns null so that we can easily ignore cases; | ||
134 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
135 | * <!-- end-user-doc --> | ||
136 | * @return the new adapter. | ||
137 | * @see simpleStatechart.Statechart | ||
138 | * @generated | ||
139 | */ | ||
140 | public Adapter createStatechartAdapter() { | ||
141 | return null; | ||
142 | } | ||
143 | |||
144 | /** | ||
145 | * Creates a new adapter for the default case. | ||
146 | * <!-- begin-user-doc --> | ||
147 | * This default implementation returns null. | ||
148 | * <!-- end-user-doc --> | ||
149 | * @return the new adapter. | ||
150 | * @generated | ||
151 | */ | ||
152 | public Adapter createEObjectAdapter() { | ||
153 | return null; | ||
154 | } | ||
155 | |||
156 | } //SimpleStatechartAdapterFactory | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/util/SimpleStatechartSwitch.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/util/SimpleStatechartSwitch.java new file mode 100644 index 00000000..30c60e74 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/util/SimpleStatechartSwitch.java | |||
@@ -0,0 +1,152 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package simpleStatechart.util; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | |||
8 | import org.eclipse.emf.ecore.util.Switch; | ||
9 | |||
10 | import simpleStatechart.*; | ||
11 | |||
12 | /** | ||
13 | * <!-- begin-user-doc --> | ||
14 | * The <b>Switch</b> for the model's inheritance hierarchy. | ||
15 | * It supports the call {@link #doSwitch(EObject) doSwitch(object)} | ||
16 | * to invoke the <code>caseXXX</code> method for each class of the model, | ||
17 | * starting with the actual class of the object | ||
18 | * and proceeding up the inheritance hierarchy | ||
19 | * until a non-null result is returned, | ||
20 | * which is the result of the switch. | ||
21 | * <!-- end-user-doc --> | ||
22 | * @see simpleStatechart.SimpleStatechartPackage | ||
23 | * @generated | ||
24 | */ | ||
25 | public class SimpleStatechartSwitch<T> extends Switch<T> { | ||
26 | /** | ||
27 | * The cached model package | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | protected static SimpleStatechartPackage modelPackage; | ||
33 | |||
34 | /** | ||
35 | * Creates an instance of the switch. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | public SimpleStatechartSwitch() { | ||
41 | if (modelPackage == null) { | ||
42 | modelPackage = SimpleStatechartPackage.eINSTANCE; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * Checks whether this is a switch for the given package. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @param ePackage the package in question. | ||
51 | * @return whether this is a switch for the given package. | ||
52 | * @generated | ||
53 | */ | ||
54 | @Override | ||
55 | protected boolean isSwitchFor(EPackage ePackage) { | ||
56 | return ePackage == modelPackage; | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @return the first non-null result returned by a <code>caseXXX</code> call. | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected T doSwitch(int classifierID, EObject theEObject) { | ||
68 | switch (classifierID) { | ||
69 | case SimpleStatechartPackage.STATE: { | ||
70 | State state = (State)theEObject; | ||
71 | T result = caseState(state); | ||
72 | if (result == null) result = defaultCase(theEObject); | ||
73 | return result; | ||
74 | } | ||
75 | case SimpleStatechartPackage.ENTRY: { | ||
76 | Entry entry = (Entry)theEObject; | ||
77 | T result = caseEntry(entry); | ||
78 | if (result == null) result = defaultCase(theEObject); | ||
79 | return result; | ||
80 | } | ||
81 | case SimpleStatechartPackage.STATECHART: { | ||
82 | Statechart statechart = (Statechart)theEObject; | ||
83 | T result = caseStatechart(statechart); | ||
84 | if (result == null) result = defaultCase(theEObject); | ||
85 | return result; | ||
86 | } | ||
87 | default: return defaultCase(theEObject); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | /** | ||
92 | * Returns the result of interpreting the object as an instance of '<em>State</em>'. | ||
93 | * <!-- begin-user-doc --> | ||
94 | * This implementation returns null; | ||
95 | * returning a non-null result will terminate the switch. | ||
96 | * <!-- end-user-doc --> | ||
97 | * @param object the target of the switch. | ||
98 | * @return the result of interpreting the object as an instance of '<em>State</em>'. | ||
99 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
100 | * @generated | ||
101 | */ | ||
102 | public T caseState(State object) { | ||
103 | return null; | ||
104 | } | ||
105 | |||
106 | /** | ||
107 | * Returns the result of interpreting the object as an instance of '<em>Entry</em>'. | ||
108 | * <!-- begin-user-doc --> | ||
109 | * This implementation returns null; | ||
110 | * returning a non-null result will terminate the switch. | ||
111 | * <!-- end-user-doc --> | ||
112 | * @param object the target of the switch. | ||
113 | * @return the result of interpreting the object as an instance of '<em>Entry</em>'. | ||
114 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
115 | * @generated | ||
116 | */ | ||
117 | public T caseEntry(Entry object) { | ||
118 | return null; | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * Returns the result of interpreting the object as an instance of '<em>Statechart</em>'. | ||
123 | * <!-- begin-user-doc --> | ||
124 | * This implementation returns null; | ||
125 | * returning a non-null result will terminate the switch. | ||
126 | * <!-- end-user-doc --> | ||
127 | * @param object the target of the switch. | ||
128 | * @return the result of interpreting the object as an instance of '<em>Statechart</em>'. | ||
129 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
130 | * @generated | ||
131 | */ | ||
132 | public T caseStatechart(Statechart object) { | ||
133 | return null; | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
138 | * <!-- begin-user-doc --> | ||
139 | * This implementation returns null; | ||
140 | * returning a non-null result will terminate the switch, but this is the last case anyway. | ||
141 | * <!-- end-user-doc --> | ||
142 | * @param object the target of the switch. | ||
143 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
144 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) | ||
145 | * @generated | ||
146 | */ | ||
147 | @Override | ||
148 | public T defaultCase(EObject object) { | ||
149 | return null; | ||
150 | } | ||
151 | |||
152 | } //SimpleStatechartSwitch | ||