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.java139
-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.java385
-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/SimpleSegmentImpl.java37
-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
7 files changed, 1724 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..60947533
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java
@@ -0,0 +1,139 @@
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 case Modes3Package.SIMPLE_SEGMENT: return createSimpleSegment();
64 default:
65 throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
66 }
67 }
68
69 /**
70 * <!-- begin-user-doc -->
71 * <!-- end-user-doc -->
72 * @generated
73 */
74 public Segment createSegment() {
75 SegmentImpl segment = new SegmentImpl();
76 return segment;
77 }
78
79 /**
80 * <!-- begin-user-doc -->
81 * <!-- end-user-doc -->
82 * @generated
83 */
84 public Modes3ModelRoot createModes3ModelRoot() {
85 Modes3ModelRootImpl modes3ModelRoot = new Modes3ModelRootImpl();
86 return modes3ModelRoot;
87 }
88
89 /**
90 * <!-- begin-user-doc -->
91 * <!-- end-user-doc -->
92 * @generated
93 */
94 public Turnout createTurnout() {
95 TurnoutImpl turnout = new TurnoutImpl();
96 return turnout;
97 }
98
99 /**
100 * <!-- begin-user-doc -->
101 * <!-- end-user-doc -->
102 * @generated
103 */
104 public Train createTrain() {
105 TrainImpl train = new TrainImpl();
106 return train;
107 }
108
109 /**
110 * <!-- begin-user-doc -->
111 * <!-- end-user-doc -->
112 * @generated
113 */
114 public SimpleSegment createSimpleSegment() {
115 SimpleSegmentImpl simpleSegment = new SimpleSegmentImpl();
116 return simpleSegment;
117 }
118
119 /**
120 * <!-- begin-user-doc -->
121 * <!-- end-user-doc -->
122 * @generated
123 */
124 public Modes3Package getModes3Package() {
125 return (Modes3Package)getEPackage();
126 }
127
128 /**
129 * <!-- begin-user-doc -->
130 * <!-- end-user-doc -->
131 * @deprecated
132 * @generated
133 */
134 @Deprecated
135 public static Modes3Package getPackage() {
136 return Modes3Package.eINSTANCE;
137 }
138
139} //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..ccab1f29
--- /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.SimpleSegment;
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<SimpleSegment> 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<SimpleSegment> getSegments() {
152 if (segments == null) {
153 segments = new EObjectContainmentEList<SimpleSegment>(SimpleSegment.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 SimpleSegment>)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..557da4c1
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java
@@ -0,0 +1,385 @@
1/**
2 */
3package modes3.impl;
4
5import modes3.Modes3Factory;
6import modes3.Modes3ModelRoot;
7import modes3.Modes3Package;
8import modes3.Segment;
9import modes3.SimpleSegment;
10import modes3.Train;
11import modes3.Turnout;
12
13import org.eclipse.emf.ecore.EAttribute;
14import org.eclipse.emf.ecore.EClass;
15import org.eclipse.emf.ecore.EPackage;
16import org.eclipse.emf.ecore.EReference;
17
18import org.eclipse.emf.ecore.impl.EPackageImpl;
19
20/**
21 * <!-- begin-user-doc -->
22 * An implementation of the model <b>Package</b>.
23 * <!-- end-user-doc -->
24 * @generated
25 */
26public class Modes3PackageImpl extends EPackageImpl implements Modes3Package {
27 /**
28 * <!-- begin-user-doc -->
29 * <!-- end-user-doc -->
30 * @generated
31 */
32 private EClass segmentEClass = null;
33
34 /**
35 * <!-- begin-user-doc -->
36 * <!-- end-user-doc -->
37 * @generated
38 */
39 private EClass modes3ModelRootEClass = null;
40
41 /**
42 * <!-- begin-user-doc -->
43 * <!-- end-user-doc -->
44 * @generated
45 */
46 private EClass turnoutEClass = null;
47
48 /**
49 * <!-- begin-user-doc -->
50 * <!-- end-user-doc -->
51 * @generated
52 */
53 private EClass trainEClass = null;
54
55 /**
56 * <!-- begin-user-doc -->
57 * <!-- end-user-doc -->
58 * @generated
59 */
60 private EClass simpleSegmentEClass = null;
61
62 /**
63 * Creates an instance of the model <b>Package</b>, registered with
64 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
65 * package URI value.
66 * <p>Note: the correct way to create the package is via the static
67 * factory method {@link #init init()}, which also performs
68 * initialization of the package, or returns the registered package,
69 * if one already exists.
70 * <!-- begin-user-doc -->
71 * <!-- end-user-doc -->
72 * @see org.eclipse.emf.ecore.EPackage.Registry
73 * @see modes3.Modes3Package#eNS_URI
74 * @see #init()
75 * @generated
76 */
77 private Modes3PackageImpl() {
78 super(eNS_URI, Modes3Factory.eINSTANCE);
79 }
80
81 /**
82 * <!-- begin-user-doc -->
83 * <!-- end-user-doc -->
84 * @generated
85 */
86 private static boolean isInited = false;
87
88 /**
89 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
90 *
91 * <p>This method is used to initialize {@link Modes3Package#eINSTANCE} when that field is accessed.
92 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
93 * <!-- begin-user-doc -->
94 * <!-- end-user-doc -->
95 * @see #eNS_URI
96 * @see #createPackageContents()
97 * @see #initializePackageContents()
98 * @generated
99 */
100 public static Modes3Package init() {
101 if (isInited) return (Modes3Package)EPackage.Registry.INSTANCE.getEPackage(Modes3Package.eNS_URI);
102
103 // Obtain or create and register package
104 Object registeredModes3Package = EPackage.Registry.INSTANCE.get(eNS_URI);
105 Modes3PackageImpl theModes3Package = registeredModes3Package instanceof Modes3PackageImpl ? (Modes3PackageImpl)registeredModes3Package : new Modes3PackageImpl();
106
107 isInited = true;
108
109 // Create package meta-data objects
110 theModes3Package.createPackageContents();
111
112 // Initialize created meta-data
113 theModes3Package.initializePackageContents();
114
115 // Mark meta-data to indicate it can't be changed
116 theModes3Package.freeze();
117
118 // Update the registry and return the package
119 EPackage.Registry.INSTANCE.put(Modes3Package.eNS_URI, theModes3Package);
120 return theModes3Package;
121 }
122
123 /**
124 * <!-- begin-user-doc -->
125 * <!-- end-user-doc -->
126 * @generated
127 */
128 public EClass getSegment() {
129 return segmentEClass;
130 }
131
132 /**
133 * <!-- begin-user-doc -->
134 * <!-- end-user-doc -->
135 * @generated
136 */
137 public EReference getSegment_ConnectedTo() {
138 return (EReference)segmentEClass.getEStructuralFeatures().get(0);
139 }
140
141 /**
142 * <!-- begin-user-doc -->
143 * <!-- end-user-doc -->
144 * @generated
145 */
146 public EReference getSegment_OccupiedBy() {
147 return (EReference)segmentEClass.getEStructuralFeatures().get(1);
148 }
149
150 /**
151 * <!-- begin-user-doc -->
152 * <!-- end-user-doc -->
153 * @generated
154 */
155 public EAttribute getSegment_Id() {
156 return (EAttribute)segmentEClass.getEStructuralFeatures().get(2);
157 }
158
159 /**
160 * <!-- begin-user-doc -->
161 * <!-- end-user-doc -->
162 * @generated
163 */
164 public EClass getModes3ModelRoot() {
165 return modes3ModelRootEClass;
166 }
167
168 /**
169 * <!-- begin-user-doc -->
170 * <!-- end-user-doc -->
171 * @generated
172 */
173 public EAttribute getModes3ModelRoot_Id() {
174 return (EAttribute)modes3ModelRootEClass.getEStructuralFeatures().get(0);
175 }
176
177 /**
178 * <!-- begin-user-doc -->
179 * <!-- end-user-doc -->
180 * @generated
181 */
182 public EReference getModes3ModelRoot_Trains() {
183 return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(1);
184 }
185
186 /**
187 * <!-- begin-user-doc -->
188 * <!-- end-user-doc -->
189 * @generated
190 */
191 public EReference getModes3ModelRoot_Segments() {
192 return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(2);
193 }
194
195 /**
196 * <!-- begin-user-doc -->
197 * <!-- end-user-doc -->
198 * @generated
199 */
200 public EReference getModes3ModelRoot_Turnouts() {
201 return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(3);
202 }
203
204 /**
205 * <!-- begin-user-doc -->
206 * <!-- end-user-doc -->
207 * @generated
208 */
209 public EClass getTurnout() {
210 return turnoutEClass;
211 }
212
213 /**
214 * <!-- begin-user-doc -->
215 * <!-- end-user-doc -->
216 * @generated
217 */
218 public EReference getTurnout_Straight() {
219 return (EReference)turnoutEClass.getEStructuralFeatures().get(0);
220 }
221
222 /**
223 * <!-- begin-user-doc -->
224 * <!-- end-user-doc -->
225 * @generated
226 */
227 public EReference getTurnout_Divergent() {
228 return (EReference)turnoutEClass.getEStructuralFeatures().get(1);
229 }
230
231 /**
232 * <!-- begin-user-doc -->
233 * <!-- end-user-doc -->
234 * @generated
235 */
236 public EClass getTrain() {
237 return trainEClass;
238 }
239
240 /**
241 * <!-- begin-user-doc -->
242 * <!-- end-user-doc -->
243 * @generated
244 */
245 public EReference getTrain_Location() {
246 return (EReference)trainEClass.getEStructuralFeatures().get(0);
247 }
248
249 /**
250 * <!-- begin-user-doc -->
251 * <!-- end-user-doc -->
252 * @generated
253 */
254 public EAttribute getTrain_Id() {
255 return (EAttribute)trainEClass.getEStructuralFeatures().get(1);
256 }
257
258 /**
259 * <!-- begin-user-doc -->
260 * <!-- end-user-doc -->
261 * @generated
262 */
263 public EAttribute getTrain_Speed() {
264 return (EAttribute)trainEClass.getEStructuralFeatures().get(2);
265 }
266
267 /**
268 * <!-- begin-user-doc -->
269 * <!-- end-user-doc -->
270 * @generated
271 */
272 public EClass getSimpleSegment() {
273 return simpleSegmentEClass;
274 }
275
276 /**
277 * <!-- begin-user-doc -->
278 * <!-- end-user-doc -->
279 * @generated
280 */
281 public Modes3Factory getModes3Factory() {
282 return (Modes3Factory)getEFactoryInstance();
283 }
284
285 /**
286 * <!-- begin-user-doc -->
287 * <!-- end-user-doc -->
288 * @generated
289 */
290 private boolean isCreated = false;
291
292 /**
293 * Creates the meta-model objects for the package. This method is
294 * guarded to have no affect on any invocation but its first.
295 * <!-- begin-user-doc -->
296 * <!-- end-user-doc -->
297 * @generated
298 */
299 public void createPackageContents() {
300 if (isCreated) return;
301 isCreated = true;
302
303 // Create classes and their features
304 segmentEClass = createEClass(SEGMENT);
305 createEReference(segmentEClass, SEGMENT__CONNECTED_TO);
306 createEReference(segmentEClass, SEGMENT__OCCUPIED_BY);
307 createEAttribute(segmentEClass, SEGMENT__ID);
308
309 modes3ModelRootEClass = createEClass(MODES3_MODEL_ROOT);
310 createEAttribute(modes3ModelRootEClass, MODES3_MODEL_ROOT__ID);
311 createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__TRAINS);
312 createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__SEGMENTS);
313 createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__TURNOUTS);
314
315 turnoutEClass = createEClass(TURNOUT);
316 createEReference(turnoutEClass, TURNOUT__STRAIGHT);
317 createEReference(turnoutEClass, TURNOUT__DIVERGENT);
318
319 trainEClass = createEClass(TRAIN);
320 createEReference(trainEClass, TRAIN__LOCATION);
321 createEAttribute(trainEClass, TRAIN__ID);
322 createEAttribute(trainEClass, TRAIN__SPEED);
323
324 simpleSegmentEClass = createEClass(SIMPLE_SEGMENT);
325 }
326
327 /**
328 * <!-- begin-user-doc -->
329 * <!-- end-user-doc -->
330 * @generated
331 */
332 private boolean isInitialized = false;
333
334 /**
335 * Complete the initialization of the package and its meta-model. This
336 * method is guarded to have no affect on any invocation but its first.
337 * <!-- begin-user-doc -->
338 * <!-- end-user-doc -->
339 * @generated
340 */
341 public void initializePackageContents() {
342 if (isInitialized) return;
343 isInitialized = true;
344
345 // Initialize package
346 setName(eNAME);
347 setNsPrefix(eNS_PREFIX);
348 setNsURI(eNS_URI);
349
350 // Create type parameters
351
352 // Set bounds for type parameters
353
354 // Add supertypes to classes
355 turnoutEClass.getESuperTypes().add(this.getSegment());
356 simpleSegmentEClass.getESuperTypes().add(this.getSegment());
357
358 // Initialize classes, features, and operations; add parameters
359 initEClass(segmentEClass, Segment.class, "Segment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
360 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);
361 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);
362 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);
363
364 initEClass(modes3ModelRootEClass, Modes3ModelRoot.class, "Modes3ModelRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
365 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);
366 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);
367 initEReference(getModes3ModelRoot_Segments(), this.getSimpleSegment(), 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);
368 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);
369
370 initEClass(turnoutEClass, Turnout.class, "Turnout", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
371 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);
372 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);
373
374 initEClass(trainEClass, Train.class, "Train", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
375 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);
376 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);
377 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);
378
379 initEClass(simpleSegmentEClass, SimpleSegment.class, "SimpleSegment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
380
381 // Create resource
382 createResource(eNS_URI);
383 }
384
385} //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/SimpleSegmentImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SimpleSegmentImpl.java
new file mode 100644
index 00000000..e3fd6c34
--- /dev/null
+++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SimpleSegmentImpl.java
@@ -0,0 +1,37 @@
1/**
2 */
3package modes3.impl;
4
5import modes3.Modes3Package;
6import modes3.SimpleSegment;
7
8import org.eclipse.emf.ecore.EClass;
9
10/**
11 * <!-- begin-user-doc -->
12 * An implementation of the model object '<em><b>Simple Segment</b></em>'.
13 * <!-- end-user-doc -->
14 *
15 * @generated
16 */
17public class SimpleSegmentImpl extends SegmentImpl implements SimpleSegment {
18 /**
19 * <!-- begin-user-doc -->
20 * <!-- end-user-doc -->
21 * @generated
22 */
23 protected SimpleSegmentImpl() {
24 super();
25 }
26
27 /**
28 * <!-- begin-user-doc -->
29 * <!-- end-user-doc -->
30 * @generated
31 */
32 @Override
33 protected EClass eStaticClass() {
34 return Modes3Package.Literals.SIMPLE_SEGMENT;
35 }
36
37} //SimpleSegmentImpl
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