aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl
diff options
context:
space:
mode:
Diffstat (limited to 'Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl')
-rw-r--r--Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java128
-rw-r--r--Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java296
-rw-r--r--Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java363
-rw-r--r--Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SegmentImpl.java319
-rw-r--r--Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TrainImpl.java332
-rw-r--r--Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TurnoutImpl.java216
6 files changed, 1654 insertions, 0 deletions
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java
new file mode 100644
index 00000000..6ec86cb6
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java
@@ -0,0 +1,128 @@
1/**
2 */
3package modes3.impl;
4
5import modes3.*;
6
7import org.eclipse.emf.ecore.EClass;
8import org.eclipse.emf.ecore.EObject;
9import org.eclipse.emf.ecore.EPackage;
10
11import org.eclipse.emf.ecore.impl.EFactoryImpl;
12
13import org.eclipse.emf.ecore.plugin.EcorePlugin;
14
15/**
16 * <!-- begin-user-doc -->
17 * An implementation of the model <b>Factory</b>.
18 * <!-- end-user-doc -->
19 * @generated
20 */
21public class Modes3FactoryImpl extends EFactoryImpl implements Modes3Factory {
22 /**
23 * Creates the default factory implementation.
24 * <!-- begin-user-doc -->
25 * <!-- end-user-doc -->
26 * @generated
27 */
28 public static Modes3Factory init() {
29 try {
30 Modes3Factory theModes3Factory = (Modes3Factory)EPackage.Registry.INSTANCE.getEFactory(Modes3Package.eNS_URI);
31 if (theModes3Factory != null) {
32 return theModes3Factory;
33 }
34 }
35 catch (Exception exception) {
36 EcorePlugin.INSTANCE.log(exception);
37 }
38 return new Modes3FactoryImpl();
39 }
40
41 /**
42 * Creates an instance of the factory.
43 * <!-- begin-user-doc -->
44 * <!-- end-user-doc -->
45 * @generated
46 */
47 public Modes3FactoryImpl() {
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 Modes3Package.SEGMENT: return createSegment();
60 case Modes3Package.MODES3_MODEL_ROOT: return createModes3ModelRoot();
61 case Modes3Package.TURNOUT: return createTurnout();
62 case Modes3Package.TRAIN: return createTrain();
63 default:
64 throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
65 }
66 }
67
68 /**
69 * <!-- begin-user-doc -->
70 * <!-- end-user-doc -->
71 * @generated
72 */
73 public Segment createSegment() {
74 SegmentImpl segment = new SegmentImpl();
75 return segment;
76 }
77
78 /**
79 * <!-- begin-user-doc -->
80 * <!-- end-user-doc -->
81 * @generated
82 */
83 public Modes3ModelRoot createModes3ModelRoot() {
84 Modes3ModelRootImpl modes3ModelRoot = new Modes3ModelRootImpl();
85 return modes3ModelRoot;
86 }
87
88 /**
89 * <!-- begin-user-doc -->
90 * <!-- end-user-doc -->
91 * @generated
92 */
93 public Turnout createTurnout() {
94 TurnoutImpl turnout = new TurnoutImpl();
95 return turnout;
96 }
97
98 /**
99 * <!-- begin-user-doc -->
100 * <!-- end-user-doc -->
101 * @generated
102 */
103 public Train createTrain() {
104 TrainImpl train = new TrainImpl();
105 return train;
106 }
107
108 /**
109 * <!-- begin-user-doc -->
110 * <!-- end-user-doc -->
111 * @generated
112 */
113 public Modes3Package getModes3Package() {
114 return (Modes3Package)getEPackage();
115 }
116
117 /**
118 * <!-- begin-user-doc -->
119 * <!-- end-user-doc -->
120 * @deprecated
121 * @generated
122 */
123 @Deprecated
124 public static Modes3Package getPackage() {
125 return Modes3Package.eINSTANCE;
126 }
127
128} //Modes3FactoryImpl
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java
new file mode 100644
index 00000000..d1ee25ff
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java
@@ -0,0 +1,296 @@
1/**
2 */
3package modes3.impl;
4
5import java.util.Collection;
6
7import modes3.Modes3ModelRoot;
8import modes3.Modes3Package;
9import modes3.Segment;
10import modes3.Train;
11import modes3.Turnout;
12
13import org.eclipse.emf.common.notify.Notification;
14import org.eclipse.emf.common.notify.NotificationChain;
15
16import org.eclipse.emf.common.util.EList;
17
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.emf.ecore.InternalEObject;
20
21import org.eclipse.emf.ecore.impl.ENotificationImpl;
22import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
23
24import org.eclipse.emf.ecore.util.EObjectContainmentEList;
25import org.eclipse.emf.ecore.util.InternalEList;
26
27/**
28 * <!-- begin-user-doc -->
29 * An implementation of the model object '<em><b>Model Root</b></em>'.
30 * <!-- end-user-doc -->
31 * <p>
32 * The following features are implemented:
33 * </p>
34 * <ul>
35 * <li>{@link modes3.impl.Modes3ModelRootImpl#getId <em>Id</em>}</li>
36 * <li>{@link modes3.impl.Modes3ModelRootImpl#getTrains <em>Trains</em>}</li>
37 * <li>{@link modes3.impl.Modes3ModelRootImpl#getSegments <em>Segments</em>}</li>
38 * <li>{@link modes3.impl.Modes3ModelRootImpl#getTurnouts <em>Turnouts</em>}</li>
39 * </ul>
40 *
41 * @generated
42 */
43public class Modes3ModelRootImpl extends MinimalEObjectImpl.Container implements Modes3ModelRoot {
44 /**
45 * The default value of the '{@link #getId() <em>Id</em>}' attribute.
46 * <!-- begin-user-doc -->
47 * <!-- end-user-doc -->
48 * @see #getId()
49 * @generated
50 * @ordered
51 */
52 protected static final int ID_EDEFAULT = 0;
53
54 /**
55 * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
56 * <!-- begin-user-doc -->
57 * <!-- end-user-doc -->
58 * @see #getId()
59 * @generated
60 * @ordered
61 */
62 protected int id = ID_EDEFAULT;
63
64 /**
65 * The cached value of the '{@link #getTrains() <em>Trains</em>}' containment reference list.
66 * <!-- begin-user-doc -->
67 * <!-- end-user-doc -->
68 * @see #getTrains()
69 * @generated
70 * @ordered
71 */
72 protected EList<Train> trains;
73
74 /**
75 * The cached value of the '{@link #getSegments() <em>Segments</em>}' containment reference list.
76 * <!-- begin-user-doc -->
77 * <!-- end-user-doc -->
78 * @see #getSegments()
79 * @generated
80 * @ordered
81 */
82 protected EList<Segment> segments;
83
84 /**
85 * The cached value of the '{@link #getTurnouts() <em>Turnouts</em>}' containment reference list.
86 * <!-- begin-user-doc -->
87 * <!-- end-user-doc -->
88 * @see #getTurnouts()
89 * @generated
90 * @ordered
91 */
92 protected EList<Turnout> turnouts;
93
94 /**
95 * <!-- begin-user-doc -->
96 * <!-- end-user-doc -->
97 * @generated
98 */
99 protected Modes3ModelRootImpl() {
100 super();
101 }
102
103 /**
104 * <!-- begin-user-doc -->
105 * <!-- end-user-doc -->
106 * @generated
107 */
108 @Override
109 protected EClass eStaticClass() {
110 return Modes3Package.Literals.MODES3_MODEL_ROOT;
111 }
112
113 /**
114 * <!-- begin-user-doc -->
115 * <!-- end-user-doc -->
116 * @generated
117 */
118 public int getId() {
119 return id;
120 }
121
122 /**
123 * <!-- begin-user-doc -->
124 * <!-- end-user-doc -->
125 * @generated
126 */
127 public void setId(int newId) {
128 int oldId = id;
129 id = newId;
130 if (eNotificationRequired())
131 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.MODES3_MODEL_ROOT__ID, oldId, id));
132 }
133
134 /**
135 * <!-- begin-user-doc -->
136 * <!-- end-user-doc -->
137 * @generated
138 */
139 public EList<Train> getTrains() {
140 if (trains == null) {
141 trains = new EObjectContainmentEList<Train>(Train.class, this, Modes3Package.MODES3_MODEL_ROOT__TRAINS);
142 }
143 return trains;
144 }
145
146 /**
147 * <!-- begin-user-doc -->
148 * <!-- end-user-doc -->
149 * @generated
150 */
151 public EList<Segment> getSegments() {
152 if (segments == null) {
153 segments = new EObjectContainmentEList<Segment>(Segment.class, this, Modes3Package.MODES3_MODEL_ROOT__SEGMENTS);
154 }
155 return segments;
156 }
157
158 /**
159 * <!-- begin-user-doc -->
160 * <!-- end-user-doc -->
161 * @generated
162 */
163 public EList<Turnout> getTurnouts() {
164 if (turnouts == null) {
165 turnouts = new EObjectContainmentEList<Turnout>(Turnout.class, this, Modes3Package.MODES3_MODEL_ROOT__TURNOUTS);
166 }
167 return turnouts;
168 }
169
170 /**
171 * <!-- begin-user-doc -->
172 * <!-- end-user-doc -->
173 * @generated
174 */
175 @Override
176 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
177 switch (featureID) {
178 case Modes3Package.MODES3_MODEL_ROOT__TRAINS:
179 return ((InternalEList<?>)getTrains()).basicRemove(otherEnd, msgs);
180 case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS:
181 return ((InternalEList<?>)getSegments()).basicRemove(otherEnd, msgs);
182 case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS:
183 return ((InternalEList<?>)getTurnouts()).basicRemove(otherEnd, msgs);
184 }
185 return super.eInverseRemove(otherEnd, featureID, msgs);
186 }
187
188 /**
189 * <!-- begin-user-doc -->
190 * <!-- end-user-doc -->
191 * @generated
192 */
193 @Override
194 public Object eGet(int featureID, boolean resolve, boolean coreType) {
195 switch (featureID) {
196 case Modes3Package.MODES3_MODEL_ROOT__ID:
197 return getId();
198 case Modes3Package.MODES3_MODEL_ROOT__TRAINS:
199 return getTrains();
200 case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS:
201 return getSegments();
202 case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS:
203 return getTurnouts();
204 }
205 return super.eGet(featureID, resolve, coreType);
206 }
207
208 /**
209 * <!-- begin-user-doc -->
210 * <!-- end-user-doc -->
211 * @generated
212 */
213 @SuppressWarnings("unchecked")
214 @Override
215 public void eSet(int featureID, Object newValue) {
216 switch (featureID) {
217 case Modes3Package.MODES3_MODEL_ROOT__ID:
218 setId((Integer)newValue);
219 return;
220 case Modes3Package.MODES3_MODEL_ROOT__TRAINS:
221 getTrains().clear();
222 getTrains().addAll((Collection<? extends Train>)newValue);
223 return;
224 case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS:
225 getSegments().clear();
226 getSegments().addAll((Collection<? extends Segment>)newValue);
227 return;
228 case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS:
229 getTurnouts().clear();
230 getTurnouts().addAll((Collection<? extends Turnout>)newValue);
231 return;
232 }
233 super.eSet(featureID, newValue);
234 }
235
236 /**
237 * <!-- begin-user-doc -->
238 * <!-- end-user-doc -->
239 * @generated
240 */
241 @Override
242 public void eUnset(int featureID) {
243 switch (featureID) {
244 case Modes3Package.MODES3_MODEL_ROOT__ID:
245 setId(ID_EDEFAULT);
246 return;
247 case Modes3Package.MODES3_MODEL_ROOT__TRAINS:
248 getTrains().clear();
249 return;
250 case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS:
251 getSegments().clear();
252 return;
253 case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS:
254 getTurnouts().clear();
255 return;
256 }
257 super.eUnset(featureID);
258 }
259
260 /**
261 * <!-- begin-user-doc -->
262 * <!-- end-user-doc -->
263 * @generated
264 */
265 @Override
266 public boolean eIsSet(int featureID) {
267 switch (featureID) {
268 case Modes3Package.MODES3_MODEL_ROOT__ID:
269 return id != ID_EDEFAULT;
270 case Modes3Package.MODES3_MODEL_ROOT__TRAINS:
271 return trains != null && !trains.isEmpty();
272 case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS:
273 return segments != null && !segments.isEmpty();
274 case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS:
275 return turnouts != null && !turnouts.isEmpty();
276 }
277 return super.eIsSet(featureID);
278 }
279
280 /**
281 * <!-- begin-user-doc -->
282 * <!-- end-user-doc -->
283 * @generated
284 */
285 @Override
286 public String toString() {
287 if (eIsProxy()) return super.toString();
288
289 StringBuilder result = new StringBuilder(super.toString());
290 result.append(" (id: ");
291 result.append(id);
292 result.append(')');
293 return result.toString();
294 }
295
296} //Modes3ModelRootImpl
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java
new file mode 100644
index 00000000..2b9e828c
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java
@@ -0,0 +1,363 @@
1/**
2 */
3package modes3.impl;
4
5import modes3.Modes3Factory;
6import modes3.Modes3ModelRoot;
7import modes3.Modes3Package;
8import modes3.Segment;
9import modes3.Train;
10import modes3.Turnout;
11
12import org.eclipse.emf.ecore.EAttribute;
13import org.eclipse.emf.ecore.EClass;
14import org.eclipse.emf.ecore.EPackage;
15import org.eclipse.emf.ecore.EReference;
16
17import org.eclipse.emf.ecore.impl.EPackageImpl;
18
19/**
20 * <!-- begin-user-doc -->
21 * An implementation of the model <b>Package</b>.
22 * <!-- end-user-doc -->
23 * @generated
24 */
25public class Modes3PackageImpl extends EPackageImpl implements Modes3Package {
26 /**
27 * <!-- begin-user-doc -->
28 * <!-- end-user-doc -->
29 * @generated
30 */
31 private EClass segmentEClass = null;
32
33 /**
34 * <!-- begin-user-doc -->
35 * <!-- end-user-doc -->
36 * @generated
37 */
38 private EClass modes3ModelRootEClass = null;
39
40 /**
41 * <!-- begin-user-doc -->
42 * <!-- end-user-doc -->
43 * @generated
44 */
45 private EClass turnoutEClass = null;
46
47 /**
48 * <!-- begin-user-doc -->
49 * <!-- end-user-doc -->
50 * @generated
51 */
52 private EClass trainEClass = null;
53
54 /**
55 * Creates an instance of the model <b>Package</b>, registered with
56 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
57 * package URI value.
58 * <p>Note: the correct way to create the package is via the static
59 * factory method {@link #init init()}, which also performs
60 * initialization of the package, or returns the registered package,
61 * if one already exists.
62 * <!-- begin-user-doc -->
63 * <!-- end-user-doc -->
64 * @see org.eclipse.emf.ecore.EPackage.Registry
65 * @see modes3.Modes3Package#eNS_URI
66 * @see #init()
67 * @generated
68 */
69 private Modes3PackageImpl() {
70 super(eNS_URI, Modes3Factory.eINSTANCE);
71 }
72
73 /**
74 * <!-- begin-user-doc -->
75 * <!-- end-user-doc -->
76 * @generated
77 */
78 private static boolean isInited = false;
79
80 /**
81 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
82 *
83 * <p>This method is used to initialize {@link Modes3Package#eINSTANCE} when that field is accessed.
84 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
85 * <!-- begin-user-doc -->
86 * <!-- end-user-doc -->
87 * @see #eNS_URI
88 * @see #createPackageContents()
89 * @see #initializePackageContents()
90 * @generated
91 */
92 public static Modes3Package init() {
93 if (isInited) return (Modes3Package)EPackage.Registry.INSTANCE.getEPackage(Modes3Package.eNS_URI);
94
95 // Obtain or create and register package
96 Object registeredModes3Package = EPackage.Registry.INSTANCE.get(eNS_URI);
97 Modes3PackageImpl theModes3Package = registeredModes3Package instanceof Modes3PackageImpl ? (Modes3PackageImpl)registeredModes3Package : new Modes3PackageImpl();
98
99 isInited = true;
100
101 // Create package meta-data objects
102 theModes3Package.createPackageContents();
103
104 // Initialize created meta-data
105 theModes3Package.initializePackageContents();
106
107 // Mark meta-data to indicate it can't be changed
108 theModes3Package.freeze();
109
110 // Update the registry and return the package
111 EPackage.Registry.INSTANCE.put(Modes3Package.eNS_URI, theModes3Package);
112 return theModes3Package;
113 }
114
115 /**
116 * <!-- begin-user-doc -->
117 * <!-- end-user-doc -->
118 * @generated
119 */
120 public EClass getSegment() {
121 return segmentEClass;
122 }
123
124 /**
125 * <!-- begin-user-doc -->
126 * <!-- end-user-doc -->
127 * @generated
128 */
129 public EReference getSegment_ConnectedTo() {
130 return (EReference)segmentEClass.getEStructuralFeatures().get(0);
131 }
132
133 /**
134 * <!-- begin-user-doc -->
135 * <!-- end-user-doc -->
136 * @generated
137 */
138 public EReference getSegment_OccupiedBy() {
139 return (EReference)segmentEClass.getEStructuralFeatures().get(1);
140 }
141
142 /**
143 * <!-- begin-user-doc -->
144 * <!-- end-user-doc -->
145 * @generated
146 */
147 public EAttribute getSegment_Id() {
148 return (EAttribute)segmentEClass.getEStructuralFeatures().get(2);
149 }
150
151 /**
152 * <!-- begin-user-doc -->
153 * <!-- end-user-doc -->
154 * @generated
155 */
156 public EClass getModes3ModelRoot() {
157 return modes3ModelRootEClass;
158 }
159
160 /**
161 * <!-- begin-user-doc -->
162 * <!-- end-user-doc -->
163 * @generated
164 */
165 public EAttribute getModes3ModelRoot_Id() {
166 return (EAttribute)modes3ModelRootEClass.getEStructuralFeatures().get(0);
167 }
168
169 /**
170 * <!-- begin-user-doc -->
171 * <!-- end-user-doc -->
172 * @generated
173 */
174 public EReference getModes3ModelRoot_Trains() {
175 return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(1);
176 }
177
178 /**
179 * <!-- begin-user-doc -->
180 * <!-- end-user-doc -->
181 * @generated
182 */
183 public EReference getModes3ModelRoot_Segments() {
184 return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(2);
185 }
186
187 /**
188 * <!-- begin-user-doc -->
189 * <!-- end-user-doc -->
190 * @generated
191 */
192 public EReference getModes3ModelRoot_Turnouts() {
193 return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(3);
194 }
195
196 /**
197 * <!-- begin-user-doc -->
198 * <!-- end-user-doc -->
199 * @generated
200 */
201 public EClass getTurnout() {
202 return turnoutEClass;
203 }
204
205 /**
206 * <!-- begin-user-doc -->
207 * <!-- end-user-doc -->
208 * @generated
209 */
210 public EReference getTurnout_Straight() {
211 return (EReference)turnoutEClass.getEStructuralFeatures().get(0);
212 }
213
214 /**
215 * <!-- begin-user-doc -->
216 * <!-- end-user-doc -->
217 * @generated
218 */
219 public EReference getTurnout_Divergent() {
220 return (EReference)turnoutEClass.getEStructuralFeatures().get(1);
221 }
222
223 /**
224 * <!-- begin-user-doc -->
225 * <!-- end-user-doc -->
226 * @generated
227 */
228 public EClass getTrain() {
229 return trainEClass;
230 }
231
232 /**
233 * <!-- begin-user-doc -->
234 * <!-- end-user-doc -->
235 * @generated
236 */
237 public EReference getTrain_Location() {
238 return (EReference)trainEClass.getEStructuralFeatures().get(0);
239 }
240
241 /**
242 * <!-- begin-user-doc -->
243 * <!-- end-user-doc -->
244 * @generated
245 */
246 public EAttribute getTrain_Id() {
247 return (EAttribute)trainEClass.getEStructuralFeatures().get(1);
248 }
249
250 /**
251 * <!-- begin-user-doc -->
252 * <!-- end-user-doc -->
253 * @generated
254 */
255 public EAttribute getTrain_Speed() {
256 return (EAttribute)trainEClass.getEStructuralFeatures().get(2);
257 }
258
259 /**
260 * <!-- begin-user-doc -->
261 * <!-- end-user-doc -->
262 * @generated
263 */
264 public Modes3Factory getModes3Factory() {
265 return (Modes3Factory)getEFactoryInstance();
266 }
267
268 /**
269 * <!-- begin-user-doc -->
270 * <!-- end-user-doc -->
271 * @generated
272 */
273 private boolean isCreated = false;
274
275 /**
276 * Creates the meta-model objects for the package. This method is
277 * guarded to have no affect on any invocation but its first.
278 * <!-- begin-user-doc -->
279 * <!-- end-user-doc -->
280 * @generated
281 */
282 public void createPackageContents() {
283 if (isCreated) return;
284 isCreated = true;
285
286 // Create classes and their features
287 segmentEClass = createEClass(SEGMENT);
288 createEReference(segmentEClass, SEGMENT__CONNECTED_TO);
289 createEReference(segmentEClass, SEGMENT__OCCUPIED_BY);
290 createEAttribute(segmentEClass, SEGMENT__ID);
291
292 modes3ModelRootEClass = createEClass(MODES3_MODEL_ROOT);
293 createEAttribute(modes3ModelRootEClass, MODES3_MODEL_ROOT__ID);
294 createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__TRAINS);
295 createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__SEGMENTS);
296 createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__TURNOUTS);
297
298 turnoutEClass = createEClass(TURNOUT);
299 createEReference(turnoutEClass, TURNOUT__STRAIGHT);
300 createEReference(turnoutEClass, TURNOUT__DIVERGENT);
301
302 trainEClass = createEClass(TRAIN);
303 createEReference(trainEClass, TRAIN__LOCATION);
304 createEAttribute(trainEClass, TRAIN__ID);
305 createEAttribute(trainEClass, TRAIN__SPEED);
306 }
307
308 /**
309 * <!-- begin-user-doc -->
310 * <!-- end-user-doc -->
311 * @generated
312 */
313 private boolean isInitialized = false;
314
315 /**
316 * Complete the initialization of the package and its meta-model. This
317 * method is guarded to have no affect on any invocation but its first.
318 * <!-- begin-user-doc -->
319 * <!-- end-user-doc -->
320 * @generated
321 */
322 public void initializePackageContents() {
323 if (isInitialized) return;
324 isInitialized = true;
325
326 // Initialize package
327 setName(eNAME);
328 setNsPrefix(eNS_PREFIX);
329 setNsURI(eNS_URI);
330
331 // Create type parameters
332
333 // Set bounds for type parameters
334
335 // Add supertypes to classes
336 turnoutEClass.getESuperTypes().add(this.getSegment());
337
338 // Initialize classes, features, and operations; add parameters
339 initEClass(segmentEClass, Segment.class, "Segment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
340 initEReference(getSegment_ConnectedTo(), this.getSegment(), null, "connectedTo", null, 0, 2, Segment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
341 initEReference(getSegment_OccupiedBy(), this.getTrain(), this.getTrain_Location(), "occupiedBy", null, 0, 1, Segment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
342 initEAttribute(getSegment_Id(), ecorePackage.getEInt(), "id", null, 0, 1, Segment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
343
344 initEClass(modes3ModelRootEClass, Modes3ModelRoot.class, "Modes3ModelRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
345 initEAttribute(getModes3ModelRoot_Id(), ecorePackage.getEInt(), "id", null, 0, 1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
346 initEReference(getModes3ModelRoot_Trains(), this.getTrain(), null, "trains", null, 0, -1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
347 initEReference(getModes3ModelRoot_Segments(), this.getSegment(), null, "segments", null, 0, -1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
348 initEReference(getModes3ModelRoot_Turnouts(), this.getTurnout(), null, "turnouts", null, 0, -1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
349
350 initEClass(turnoutEClass, Turnout.class, "Turnout", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
351 initEReference(getTurnout_Straight(), this.getSegment(), null, "straight", null, 1, 1, Turnout.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
352 initEReference(getTurnout_Divergent(), this.getSegment(), null, "divergent", null, 1, 1, Turnout.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
353
354 initEClass(trainEClass, Train.class, "Train", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
355 initEReference(getTrain_Location(), this.getSegment(), this.getSegment_OccupiedBy(), "location", null, 1, 1, Train.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
356 initEAttribute(getTrain_Id(), ecorePackage.getEInt(), "id", null, 0, 1, Train.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
357 initEAttribute(getTrain_Speed(), ecorePackage.getEDouble(), "speed", null, 0, 1, Train.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
358
359 // Create resource
360 createResource(eNS_URI);
361 }
362
363} //Modes3PackageImpl
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SegmentImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SegmentImpl.java
new file mode 100644
index 00000000..905bcec1
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SegmentImpl.java
@@ -0,0 +1,319 @@
1/**
2 */
3package modes3.impl;
4
5import java.util.Collection;
6
7import modes3.Modes3Package;
8import modes3.Segment;
9import modes3.Train;
10
11import org.eclipse.emf.common.notify.Notification;
12import org.eclipse.emf.common.notify.NotificationChain;
13
14import org.eclipse.emf.common.util.EList;
15
16import org.eclipse.emf.ecore.EClass;
17import org.eclipse.emf.ecore.InternalEObject;
18
19import org.eclipse.emf.ecore.impl.ENotificationImpl;
20import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
21
22import org.eclipse.emf.ecore.util.EObjectResolvingEList;
23
24/**
25 * <!-- begin-user-doc -->
26 * An implementation of the model object '<em><b>Segment</b></em>'.
27 * <!-- end-user-doc -->
28 * <p>
29 * The following features are implemented:
30 * </p>
31 * <ul>
32 * <li>{@link modes3.impl.SegmentImpl#getConnectedTo <em>Connected To</em>}</li>
33 * <li>{@link modes3.impl.SegmentImpl#getOccupiedBy <em>Occupied By</em>}</li>
34 * <li>{@link modes3.impl.SegmentImpl#getId <em>Id</em>}</li>
35 * </ul>
36 *
37 * @generated
38 */
39public class SegmentImpl extends MinimalEObjectImpl.Container implements Segment {
40 /**
41 * The cached value of the '{@link #getConnectedTo() <em>Connected To</em>}' reference list.
42 * <!-- begin-user-doc -->
43 * <!-- end-user-doc -->
44 * @see #getConnectedTo()
45 * @generated
46 * @ordered
47 */
48 protected EList<Segment> connectedTo;
49
50 /**
51 * The cached value of the '{@link #getOccupiedBy() <em>Occupied By</em>}' reference.
52 * <!-- begin-user-doc -->
53 * <!-- end-user-doc -->
54 * @see #getOccupiedBy()
55 * @generated
56 * @ordered
57 */
58 protected Train occupiedBy;
59
60 /**
61 * The default value of the '{@link #getId() <em>Id</em>}' attribute.
62 * <!-- begin-user-doc -->
63 * <!-- end-user-doc -->
64 * @see #getId()
65 * @generated
66 * @ordered
67 */
68 protected static final int ID_EDEFAULT = 0;
69
70 /**
71 * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
72 * <!-- begin-user-doc -->
73 * <!-- end-user-doc -->
74 * @see #getId()
75 * @generated
76 * @ordered
77 */
78 protected int id = ID_EDEFAULT;
79
80 /**
81 * <!-- begin-user-doc -->
82 * <!-- end-user-doc -->
83 * @generated
84 */
85 protected SegmentImpl() {
86 super();
87 }
88
89 /**
90 * <!-- begin-user-doc -->
91 * <!-- end-user-doc -->
92 * @generated
93 */
94 @Override
95 protected EClass eStaticClass() {
96 return Modes3Package.Literals.SEGMENT;
97 }
98
99 /**
100 * <!-- begin-user-doc -->
101 * <!-- end-user-doc -->
102 * @generated
103 */
104 public EList<Segment> getConnectedTo() {
105 if (connectedTo == null) {
106 connectedTo = new EObjectResolvingEList<Segment>(Segment.class, this, Modes3Package.SEGMENT__CONNECTED_TO);
107 }
108 return connectedTo;
109 }
110
111 /**
112 * <!-- begin-user-doc -->
113 * <!-- end-user-doc -->
114 * @generated
115 */
116 public Train getOccupiedBy() {
117 if (occupiedBy != null && occupiedBy.eIsProxy()) {
118 InternalEObject oldOccupiedBy = (InternalEObject)occupiedBy;
119 occupiedBy = (Train)eResolveProxy(oldOccupiedBy);
120 if (occupiedBy != oldOccupiedBy) {
121 if (eNotificationRequired())
122 eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.SEGMENT__OCCUPIED_BY, oldOccupiedBy, occupiedBy));
123 }
124 }
125 return occupiedBy;
126 }
127
128 /**
129 * <!-- begin-user-doc -->
130 * <!-- end-user-doc -->
131 * @generated
132 */
133 public Train basicGetOccupiedBy() {
134 return occupiedBy;
135 }
136
137 /**
138 * <!-- begin-user-doc -->
139 * <!-- end-user-doc -->
140 * @generated
141 */
142 public NotificationChain basicSetOccupiedBy(Train newOccupiedBy, NotificationChain msgs) {
143 Train oldOccupiedBy = occupiedBy;
144 occupiedBy = newOccupiedBy;
145 if (eNotificationRequired()) {
146 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Modes3Package.SEGMENT__OCCUPIED_BY, oldOccupiedBy, newOccupiedBy);
147 if (msgs == null) msgs = notification; else msgs.add(notification);
148 }
149 return msgs;
150 }
151
152 /**
153 * <!-- begin-user-doc -->
154 * <!-- end-user-doc -->
155 * @generated
156 */
157 public void setOccupiedBy(Train newOccupiedBy) {
158 if (newOccupiedBy != occupiedBy) {
159 NotificationChain msgs = null;
160 if (occupiedBy != null)
161 msgs = ((InternalEObject)occupiedBy).eInverseRemove(this, Modes3Package.TRAIN__LOCATION, Train.class, msgs);
162 if (newOccupiedBy != null)
163 msgs = ((InternalEObject)newOccupiedBy).eInverseAdd(this, Modes3Package.TRAIN__LOCATION, Train.class, msgs);
164 msgs = basicSetOccupiedBy(newOccupiedBy, msgs);
165 if (msgs != null) msgs.dispatch();
166 }
167 else if (eNotificationRequired())
168 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.SEGMENT__OCCUPIED_BY, newOccupiedBy, newOccupiedBy));
169 }
170
171 /**
172 * <!-- begin-user-doc -->
173 * <!-- end-user-doc -->
174 * @generated
175 */
176 public int getId() {
177 return id;
178 }
179
180 /**
181 * <!-- begin-user-doc -->
182 * <!-- end-user-doc -->
183 * @generated
184 */
185 public void setId(int newId) {
186 int oldId = id;
187 id = newId;
188 if (eNotificationRequired())
189 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.SEGMENT__ID, oldId, id));
190 }
191
192 /**
193 * <!-- begin-user-doc -->
194 * <!-- end-user-doc -->
195 * @generated
196 */
197 @Override
198 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
199 switch (featureID) {
200 case Modes3Package.SEGMENT__OCCUPIED_BY:
201 if (occupiedBy != null)
202 msgs = ((InternalEObject)occupiedBy).eInverseRemove(this, Modes3Package.TRAIN__LOCATION, Train.class, msgs);
203 return basicSetOccupiedBy((Train)otherEnd, msgs);
204 }
205 return super.eInverseAdd(otherEnd, featureID, msgs);
206 }
207
208 /**
209 * <!-- begin-user-doc -->
210 * <!-- end-user-doc -->
211 * @generated
212 */
213 @Override
214 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
215 switch (featureID) {
216 case Modes3Package.SEGMENT__OCCUPIED_BY:
217 return basicSetOccupiedBy(null, msgs);
218 }
219 return super.eInverseRemove(otherEnd, featureID, msgs);
220 }
221
222 /**
223 * <!-- begin-user-doc -->
224 * <!-- end-user-doc -->
225 * @generated
226 */
227 @Override
228 public Object eGet(int featureID, boolean resolve, boolean coreType) {
229 switch (featureID) {
230 case Modes3Package.SEGMENT__CONNECTED_TO:
231 return getConnectedTo();
232 case Modes3Package.SEGMENT__OCCUPIED_BY:
233 if (resolve) return getOccupiedBy();
234 return basicGetOccupiedBy();
235 case Modes3Package.SEGMENT__ID:
236 return getId();
237 }
238 return super.eGet(featureID, resolve, coreType);
239 }
240
241 /**
242 * <!-- begin-user-doc -->
243 * <!-- end-user-doc -->
244 * @generated
245 */
246 @SuppressWarnings("unchecked")
247 @Override
248 public void eSet(int featureID, Object newValue) {
249 switch (featureID) {
250 case Modes3Package.SEGMENT__CONNECTED_TO:
251 getConnectedTo().clear();
252 getConnectedTo().addAll((Collection<? extends Segment>)newValue);
253 return;
254 case Modes3Package.SEGMENT__OCCUPIED_BY:
255 setOccupiedBy((Train)newValue);
256 return;
257 case Modes3Package.SEGMENT__ID:
258 setId((Integer)newValue);
259 return;
260 }
261 super.eSet(featureID, newValue);
262 }
263
264 /**
265 * <!-- begin-user-doc -->
266 * <!-- end-user-doc -->
267 * @generated
268 */
269 @Override
270 public void eUnset(int featureID) {
271 switch (featureID) {
272 case Modes3Package.SEGMENT__CONNECTED_TO:
273 getConnectedTo().clear();
274 return;
275 case Modes3Package.SEGMENT__OCCUPIED_BY:
276 setOccupiedBy((Train)null);
277 return;
278 case Modes3Package.SEGMENT__ID:
279 setId(ID_EDEFAULT);
280 return;
281 }
282 super.eUnset(featureID);
283 }
284
285 /**
286 * <!-- begin-user-doc -->
287 * <!-- end-user-doc -->
288 * @generated
289 */
290 @Override
291 public boolean eIsSet(int featureID) {
292 switch (featureID) {
293 case Modes3Package.SEGMENT__CONNECTED_TO:
294 return connectedTo != null && !connectedTo.isEmpty();
295 case Modes3Package.SEGMENT__OCCUPIED_BY:
296 return occupiedBy != null;
297 case Modes3Package.SEGMENT__ID:
298 return id != ID_EDEFAULT;
299 }
300 return super.eIsSet(featureID);
301 }
302
303 /**
304 * <!-- begin-user-doc -->
305 * <!-- end-user-doc -->
306 * @generated
307 */
308 @Override
309 public String toString() {
310 if (eIsProxy()) return super.toString();
311
312 StringBuilder result = new StringBuilder(super.toString());
313 result.append(" (id: ");
314 result.append(id);
315 result.append(')');
316 return result.toString();
317 }
318
319} //SegmentImpl
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TrainImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TrainImpl.java
new file mode 100644
index 00000000..f096dca8
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TrainImpl.java
@@ -0,0 +1,332 @@
1/**
2 */
3package modes3.impl;
4
5import modes3.Modes3Package;
6import modes3.Segment;
7import modes3.Train;
8
9import org.eclipse.emf.common.notify.Notification;
10import org.eclipse.emf.common.notify.NotificationChain;
11
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.emf.ecore.InternalEObject;
14
15import org.eclipse.emf.ecore.impl.ENotificationImpl;
16import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
17
18/**
19 * <!-- begin-user-doc -->
20 * An implementation of the model object '<em><b>Train</b></em>'.
21 * <!-- end-user-doc -->
22 * <p>
23 * The following features are implemented:
24 * </p>
25 * <ul>
26 * <li>{@link modes3.impl.TrainImpl#getLocation <em>Location</em>}</li>
27 * <li>{@link modes3.impl.TrainImpl#getId <em>Id</em>}</li>
28 * <li>{@link modes3.impl.TrainImpl#getSpeed <em>Speed</em>}</li>
29 * </ul>
30 *
31 * @generated
32 */
33public class TrainImpl extends MinimalEObjectImpl.Container implements Train {
34 /**
35 * The cached value of the '{@link #getLocation() <em>Location</em>}' reference.
36 * <!-- begin-user-doc -->
37 * <!-- end-user-doc -->
38 * @see #getLocation()
39 * @generated
40 * @ordered
41 */
42 protected Segment location;
43
44 /**
45 * The default value of the '{@link #getId() <em>Id</em>}' attribute.
46 * <!-- begin-user-doc -->
47 * <!-- end-user-doc -->
48 * @see #getId()
49 * @generated
50 * @ordered
51 */
52 protected static final int ID_EDEFAULT = 0;
53
54 /**
55 * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
56 * <!-- begin-user-doc -->
57 * <!-- end-user-doc -->
58 * @see #getId()
59 * @generated
60 * @ordered
61 */
62 protected int id = ID_EDEFAULT;
63
64 /**
65 * The default value of the '{@link #getSpeed() <em>Speed</em>}' attribute.
66 * <!-- begin-user-doc -->
67 * <!-- end-user-doc -->
68 * @see #getSpeed()
69 * @generated
70 * @ordered
71 */
72 protected static final double SPEED_EDEFAULT = 0.0;
73
74 /**
75 * The cached value of the '{@link #getSpeed() <em>Speed</em>}' attribute.
76 * <!-- begin-user-doc -->
77 * <!-- end-user-doc -->
78 * @see #getSpeed()
79 * @generated
80 * @ordered
81 */
82 protected double speed = SPEED_EDEFAULT;
83
84 /**
85 * <!-- begin-user-doc -->
86 * <!-- end-user-doc -->
87 * @generated
88 */
89 protected TrainImpl() {
90 super();
91 }
92
93 /**
94 * <!-- begin-user-doc -->
95 * <!-- end-user-doc -->
96 * @generated
97 */
98 @Override
99 protected EClass eStaticClass() {
100 return Modes3Package.Literals.TRAIN;
101 }
102
103 /**
104 * <!-- begin-user-doc -->
105 * <!-- end-user-doc -->
106 * @generated
107 */
108 public Segment getLocation() {
109 if (location != null && location.eIsProxy()) {
110 InternalEObject oldLocation = (InternalEObject)location;
111 location = (Segment)eResolveProxy(oldLocation);
112 if (location != oldLocation) {
113 if (eNotificationRequired())
114 eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.TRAIN__LOCATION, oldLocation, location));
115 }
116 }
117 return location;
118 }
119
120 /**
121 * <!-- begin-user-doc -->
122 * <!-- end-user-doc -->
123 * @generated
124 */
125 public Segment basicGetLocation() {
126 return location;
127 }
128
129 /**
130 * <!-- begin-user-doc -->
131 * <!-- end-user-doc -->
132 * @generated
133 */
134 public NotificationChain basicSetLocation(Segment newLocation, NotificationChain msgs) {
135 Segment oldLocation = location;
136 location = newLocation;
137 if (eNotificationRequired()) {
138 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__LOCATION, oldLocation, newLocation);
139 if (msgs == null) msgs = notification; else msgs.add(notification);
140 }
141 return msgs;
142 }
143
144 /**
145 * <!-- begin-user-doc -->
146 * <!-- end-user-doc -->
147 * @generated
148 */
149 public void setLocation(Segment newLocation) {
150 if (newLocation != location) {
151 NotificationChain msgs = null;
152 if (location != null)
153 msgs = ((InternalEObject)location).eInverseRemove(this, Modes3Package.SEGMENT__OCCUPIED_BY, Segment.class, msgs);
154 if (newLocation != null)
155 msgs = ((InternalEObject)newLocation).eInverseAdd(this, Modes3Package.SEGMENT__OCCUPIED_BY, Segment.class, msgs);
156 msgs = basicSetLocation(newLocation, msgs);
157 if (msgs != null) msgs.dispatch();
158 }
159 else if (eNotificationRequired())
160 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__LOCATION, newLocation, newLocation));
161 }
162
163 /**
164 * <!-- begin-user-doc -->
165 * <!-- end-user-doc -->
166 * @generated
167 */
168 public int getId() {
169 return id;
170 }
171
172 /**
173 * <!-- begin-user-doc -->
174 * <!-- end-user-doc -->
175 * @generated
176 */
177 public void setId(int newId) {
178 int oldId = id;
179 id = newId;
180 if (eNotificationRequired())
181 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__ID, oldId, id));
182 }
183
184 /**
185 * <!-- begin-user-doc -->
186 * <!-- end-user-doc -->
187 * @generated
188 */
189 public double getSpeed() {
190 return speed;
191 }
192
193 /**
194 * <!-- begin-user-doc -->
195 * <!-- end-user-doc -->
196 * @generated
197 */
198 public void setSpeed(double newSpeed) {
199 double oldSpeed = speed;
200 speed = newSpeed;
201 if (eNotificationRequired())
202 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__SPEED, oldSpeed, speed));
203 }
204
205 /**
206 * <!-- begin-user-doc -->
207 * <!-- end-user-doc -->
208 * @generated
209 */
210 @Override
211 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
212 switch (featureID) {
213 case Modes3Package.TRAIN__LOCATION:
214 if (location != null)
215 msgs = ((InternalEObject)location).eInverseRemove(this, Modes3Package.SEGMENT__OCCUPIED_BY, Segment.class, msgs);
216 return basicSetLocation((Segment)otherEnd, msgs);
217 }
218 return super.eInverseAdd(otherEnd, featureID, msgs);
219 }
220
221 /**
222 * <!-- begin-user-doc -->
223 * <!-- end-user-doc -->
224 * @generated
225 */
226 @Override
227 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
228 switch (featureID) {
229 case Modes3Package.TRAIN__LOCATION:
230 return basicSetLocation(null, msgs);
231 }
232 return super.eInverseRemove(otherEnd, featureID, msgs);
233 }
234
235 /**
236 * <!-- begin-user-doc -->
237 * <!-- end-user-doc -->
238 * @generated
239 */
240 @Override
241 public Object eGet(int featureID, boolean resolve, boolean coreType) {
242 switch (featureID) {
243 case Modes3Package.TRAIN__LOCATION:
244 if (resolve) return getLocation();
245 return basicGetLocation();
246 case Modes3Package.TRAIN__ID:
247 return getId();
248 case Modes3Package.TRAIN__SPEED:
249 return getSpeed();
250 }
251 return super.eGet(featureID, resolve, coreType);
252 }
253
254 /**
255 * <!-- begin-user-doc -->
256 * <!-- end-user-doc -->
257 * @generated
258 */
259 @Override
260 public void eSet(int featureID, Object newValue) {
261 switch (featureID) {
262 case Modes3Package.TRAIN__LOCATION:
263 setLocation((Segment)newValue);
264 return;
265 case Modes3Package.TRAIN__ID:
266 setId((Integer)newValue);
267 return;
268 case Modes3Package.TRAIN__SPEED:
269 setSpeed((Double)newValue);
270 return;
271 }
272 super.eSet(featureID, newValue);
273 }
274
275 /**
276 * <!-- begin-user-doc -->
277 * <!-- end-user-doc -->
278 * @generated
279 */
280 @Override
281 public void eUnset(int featureID) {
282 switch (featureID) {
283 case Modes3Package.TRAIN__LOCATION:
284 setLocation((Segment)null);
285 return;
286 case Modes3Package.TRAIN__ID:
287 setId(ID_EDEFAULT);
288 return;
289 case Modes3Package.TRAIN__SPEED:
290 setSpeed(SPEED_EDEFAULT);
291 return;
292 }
293 super.eUnset(featureID);
294 }
295
296 /**
297 * <!-- begin-user-doc -->
298 * <!-- end-user-doc -->
299 * @generated
300 */
301 @Override
302 public boolean eIsSet(int featureID) {
303 switch (featureID) {
304 case Modes3Package.TRAIN__LOCATION:
305 return location != null;
306 case Modes3Package.TRAIN__ID:
307 return id != ID_EDEFAULT;
308 case Modes3Package.TRAIN__SPEED:
309 return speed != SPEED_EDEFAULT;
310 }
311 return super.eIsSet(featureID);
312 }
313
314 /**
315 * <!-- begin-user-doc -->
316 * <!-- end-user-doc -->
317 * @generated
318 */
319 @Override
320 public String toString() {
321 if (eIsProxy()) return super.toString();
322
323 StringBuilder result = new StringBuilder(super.toString());
324 result.append(" (id: ");
325 result.append(id);
326 result.append(", speed: ");
327 result.append(speed);
328 result.append(')');
329 return result.toString();
330 }
331
332} //TrainImpl
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TurnoutImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TurnoutImpl.java
new file mode 100644
index 00000000..d20a104e
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TurnoutImpl.java
@@ -0,0 +1,216 @@
1/**
2 */
3package modes3.impl;
4
5import modes3.Modes3Package;
6import modes3.Segment;
7import modes3.Turnout;
8
9import org.eclipse.emf.common.notify.Notification;
10
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.InternalEObject;
13
14import org.eclipse.emf.ecore.impl.ENotificationImpl;
15
16/**
17 * <!-- begin-user-doc -->
18 * An implementation of the model object '<em><b>Turnout</b></em>'.
19 * <!-- end-user-doc -->
20 * <p>
21 * The following features are implemented:
22 * </p>
23 * <ul>
24 * <li>{@link modes3.impl.TurnoutImpl#getStraight <em>Straight</em>}</li>
25 * <li>{@link modes3.impl.TurnoutImpl#getDivergent <em>Divergent</em>}</li>
26 * </ul>
27 *
28 * @generated
29 */
30public class TurnoutImpl extends SegmentImpl implements Turnout {
31 /**
32 * The cached value of the '{@link #getStraight() <em>Straight</em>}' reference.
33 * <!-- begin-user-doc -->
34 * <!-- end-user-doc -->
35 * @see #getStraight()
36 * @generated
37 * @ordered
38 */
39 protected Segment straight;
40
41 /**
42 * The cached value of the '{@link #getDivergent() <em>Divergent</em>}' reference.
43 * <!-- begin-user-doc -->
44 * <!-- end-user-doc -->
45 * @see #getDivergent()
46 * @generated
47 * @ordered
48 */
49 protected Segment divergent;
50
51 /**
52 * <!-- begin-user-doc -->
53 * <!-- end-user-doc -->
54 * @generated
55 */
56 protected TurnoutImpl() {
57 super();
58 }
59
60 /**
61 * <!-- begin-user-doc -->
62 * <!-- end-user-doc -->
63 * @generated
64 */
65 @Override
66 protected EClass eStaticClass() {
67 return Modes3Package.Literals.TURNOUT;
68 }
69
70 /**
71 * <!-- begin-user-doc -->
72 * <!-- end-user-doc -->
73 * @generated
74 */
75 public Segment getStraight() {
76 if (straight != null && straight.eIsProxy()) {
77 InternalEObject oldStraight = (InternalEObject)straight;
78 straight = (Segment)eResolveProxy(oldStraight);
79 if (straight != oldStraight) {
80 if (eNotificationRequired())
81 eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.TURNOUT__STRAIGHT, oldStraight, straight));
82 }
83 }
84 return straight;
85 }
86
87 /**
88 * <!-- begin-user-doc -->
89 * <!-- end-user-doc -->
90 * @generated
91 */
92 public Segment basicGetStraight() {
93 return straight;
94 }
95
96 /**
97 * <!-- begin-user-doc -->
98 * <!-- end-user-doc -->
99 * @generated
100 */
101 public void setStraight(Segment newStraight) {
102 Segment oldStraight = straight;
103 straight = newStraight;
104 if (eNotificationRequired())
105 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TURNOUT__STRAIGHT, oldStraight, straight));
106 }
107
108 /**
109 * <!-- begin-user-doc -->
110 * <!-- end-user-doc -->
111 * @generated
112 */
113 public Segment getDivergent() {
114 if (divergent != null && divergent.eIsProxy()) {
115 InternalEObject oldDivergent = (InternalEObject)divergent;
116 divergent = (Segment)eResolveProxy(oldDivergent);
117 if (divergent != oldDivergent) {
118 if (eNotificationRequired())
119 eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.TURNOUT__DIVERGENT, oldDivergent, divergent));
120 }
121 }
122 return divergent;
123 }
124
125 /**
126 * <!-- begin-user-doc -->
127 * <!-- end-user-doc -->
128 * @generated
129 */
130 public Segment basicGetDivergent() {
131 return divergent;
132 }
133
134 /**
135 * <!-- begin-user-doc -->
136 * <!-- end-user-doc -->
137 * @generated
138 */
139 public void setDivergent(Segment newDivergent) {
140 Segment oldDivergent = divergent;
141 divergent = newDivergent;
142 if (eNotificationRequired())
143 eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TURNOUT__DIVERGENT, oldDivergent, divergent));
144 }
145
146 /**
147 * <!-- begin-user-doc -->
148 * <!-- end-user-doc -->
149 * @generated
150 */
151 @Override
152 public Object eGet(int featureID, boolean resolve, boolean coreType) {
153 switch (featureID) {
154 case Modes3Package.TURNOUT__STRAIGHT:
155 if (resolve) return getStraight();
156 return basicGetStraight();
157 case Modes3Package.TURNOUT__DIVERGENT:
158 if (resolve) return getDivergent();
159 return basicGetDivergent();
160 }
161 return super.eGet(featureID, resolve, coreType);
162 }
163
164 /**
165 * <!-- begin-user-doc -->
166 * <!-- end-user-doc -->
167 * @generated
168 */
169 @Override
170 public void eSet(int featureID, Object newValue) {
171 switch (featureID) {
172 case Modes3Package.TURNOUT__STRAIGHT:
173 setStraight((Segment)newValue);
174 return;
175 case Modes3Package.TURNOUT__DIVERGENT:
176 setDivergent((Segment)newValue);
177 return;
178 }
179 super.eSet(featureID, newValue);
180 }
181
182 /**
183 * <!-- begin-user-doc -->
184 * <!-- end-user-doc -->
185 * @generated
186 */
187 @Override
188 public void eUnset(int featureID) {
189 switch (featureID) {
190 case Modes3Package.TURNOUT__STRAIGHT:
191 setStraight((Segment)null);
192 return;
193 case Modes3Package.TURNOUT__DIVERGENT:
194 setDivergent((Segment)null);
195 return;
196 }
197 super.eUnset(featureID);
198 }
199
200 /**
201 * <!-- begin-user-doc -->
202 * <!-- end-user-doc -->
203 * @generated
204 */
205 @Override
206 public boolean eIsSet(int featureID) {
207 switch (featureID) {
208 case Modes3Package.TURNOUT__STRAIGHT:
209 return straight != null;
210 case Modes3Package.TURNOUT__DIVERGENT:
211 return divergent != null;
212 }
213 return super.eIsSet(featureID);
214 }
215
216} //TurnoutImpl