From a620f07468780778bd55dcffc30245def37ece69 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 6 Aug 2020 16:07:16 +0200 Subject: MoDeS3 unit propagation WIP --- .../ecore-gen/modes3/impl/Modes3ModelRootImpl.java | 296 +++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java (limited to 'Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java') 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 @@ +/** + */ +package modes3.impl; + +import java.util.Collection; + +import modes3.Modes3ModelRoot; +import modes3.Modes3Package; +import modes3.Segment; +import modes3.Train; +import modes3.Turnout; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Model Root'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class Modes3ModelRootImpl extends MinimalEObjectImpl.Container implements Modes3ModelRoot { + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final int ID_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected int id = ID_EDEFAULT; + + /** + * The cached value of the '{@link #getTrains() Trains}' containment reference list. + * + * + * @see #getTrains() + * @generated + * @ordered + */ + protected EList trains; + + /** + * The cached value of the '{@link #getSegments() Segments}' containment reference list. + * + * + * @see #getSegments() + * @generated + * @ordered + */ + protected EList segments; + + /** + * The cached value of the '{@link #getTurnouts() Turnouts}' containment reference list. + * + * + * @see #getTurnouts() + * @generated + * @ordered + */ + protected EList turnouts; + + /** + * + * + * @generated + */ + protected Modes3ModelRootImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Modes3Package.Literals.MODES3_MODEL_ROOT; + } + + /** + * + * + * @generated + */ + public int getId() { + return id; + } + + /** + * + * + * @generated + */ + public void setId(int newId) { + int oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.MODES3_MODEL_ROOT__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + public EList getTrains() { + if (trains == null) { + trains = new EObjectContainmentEList(Train.class, this, Modes3Package.MODES3_MODEL_ROOT__TRAINS); + } + return trains; + } + + /** + * + * + * @generated + */ + public EList getSegments() { + if (segments == null) { + segments = new EObjectContainmentEList(Segment.class, this, Modes3Package.MODES3_MODEL_ROOT__SEGMENTS); + } + return segments; + } + + /** + * + * + * @generated + */ + public EList getTurnouts() { + if (turnouts == null) { + turnouts = new EObjectContainmentEList(Turnout.class, this, Modes3Package.MODES3_MODEL_ROOT__TURNOUTS); + } + return turnouts; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Modes3Package.MODES3_MODEL_ROOT__TRAINS: + return ((InternalEList)getTrains()).basicRemove(otherEnd, msgs); + case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: + return ((InternalEList)getSegments()).basicRemove(otherEnd, msgs); + case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: + return ((InternalEList)getTurnouts()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Modes3Package.MODES3_MODEL_ROOT__ID: + return getId(); + case Modes3Package.MODES3_MODEL_ROOT__TRAINS: + return getTrains(); + case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: + return getSegments(); + case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: + return getTurnouts(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Modes3Package.MODES3_MODEL_ROOT__ID: + setId((Integer)newValue); + return; + case Modes3Package.MODES3_MODEL_ROOT__TRAINS: + getTrains().clear(); + getTrains().addAll((Collection)newValue); + return; + case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: + getSegments().clear(); + getSegments().addAll((Collection)newValue); + return; + case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: + getTurnouts().clear(); + getTurnouts().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Modes3Package.MODES3_MODEL_ROOT__ID: + setId(ID_EDEFAULT); + return; + case Modes3Package.MODES3_MODEL_ROOT__TRAINS: + getTrains().clear(); + return; + case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: + getSegments().clear(); + return; + case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: + getTurnouts().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Modes3Package.MODES3_MODEL_ROOT__ID: + return id != ID_EDEFAULT; + case Modes3Package.MODES3_MODEL_ROOT__TRAINS: + return trains != null && !trains.isEmpty(); + case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: + return segments != null && !segments.isEmpty(); + case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: + return turnouts != null && !turnouts.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (id: "); + result.append(id); + result.append(')'); + return result.toString(); + } + +} //Modes3ModelRootImpl -- cgit v1.2.3-70-g09d2