diff options
Diffstat (limited to 'Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl')
5 files changed, 880 insertions, 0 deletions
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 | ||