/** */ package ca.mcgill.ecse.dslreasoner.vampire.yakindumm.impl; import ca.mcgill.ecse.dslreasoner.vampire.yakindumm.Transition; import ca.mcgill.ecse.dslreasoner.vampire.yakindumm.Vertex; import ca.mcgill.ecse.dslreasoner.vampire.yakindumm.YakindummPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; 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.EcoreUtil; /** * * An implementation of the model object 'Transition'. * *

* The following features are implemented: *

* * * @generated */ public class TransitionImpl extends MinimalEObjectImpl.Container implements Transition { /** * The cached value of the '{@link #getTarget() Target}' reference. * * * @see #getTarget() * @generated * @ordered */ protected Vertex target; /** * * * @generated */ protected TransitionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return YakindummPackage.Literals.TRANSITION; } /** * * * @generated */ public Vertex getTarget() { if (target != null && target.eIsProxy()) { InternalEObject oldTarget = (InternalEObject)target; target = (Vertex)eResolveProxy(oldTarget); if (target != oldTarget) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, YakindummPackage.TRANSITION__TARGET, oldTarget, target)); } } return target; } /** * * * @generated */ public Vertex basicGetTarget() { return target; } /** * * * @generated */ public NotificationChain basicSetTarget(Vertex newTarget, NotificationChain msgs) { Vertex oldTarget = target; target = newTarget; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, YakindummPackage.TRANSITION__TARGET, oldTarget, newTarget); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setTarget(Vertex newTarget) { if (newTarget != target) { NotificationChain msgs = null; if (target != null) msgs = ((InternalEObject)target).eInverseRemove(this, YakindummPackage.VERTEX__INCOMING_TRANSITIONS, Vertex.class, msgs); if (newTarget != null) msgs = ((InternalEObject)newTarget).eInverseAdd(this, YakindummPackage.VERTEX__INCOMING_TRANSITIONS, Vertex.class, msgs); msgs = basicSetTarget(newTarget, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, YakindummPackage.TRANSITION__TARGET, newTarget, newTarget)); } /** * * * @generated */ public Vertex getSource() { if (eContainerFeatureID() != YakindummPackage.TRANSITION__SOURCE) return null; return (Vertex)eInternalContainer(); } /** * * * @generated */ public NotificationChain basicSetSource(Vertex newSource, NotificationChain msgs) { msgs = eBasicSetContainer((InternalEObject)newSource, YakindummPackage.TRANSITION__SOURCE, msgs); return msgs; } /** * * * @generated */ public void setSource(Vertex newSource) { if (newSource != eInternalContainer() || (eContainerFeatureID() != YakindummPackage.TRANSITION__SOURCE && newSource != null)) { if (EcoreUtil.isAncestor(this, newSource)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); if (newSource != null) msgs = ((InternalEObject)newSource).eInverseAdd(this, YakindummPackage.VERTEX__OUTGOING_TRANSITIONS, Vertex.class, msgs); msgs = basicSetSource(newSource, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, YakindummPackage.TRANSITION__SOURCE, newSource, newSource)); } /** * * * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case YakindummPackage.TRANSITION__TARGET: if (target != null) msgs = ((InternalEObject)target).eInverseRemove(this, YakindummPackage.VERTEX__INCOMING_TRANSITIONS, Vertex.class, msgs); return basicSetTarget((Vertex)otherEnd, msgs); case YakindummPackage.TRANSITION__SOURCE: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return basicSetSource((Vertex)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case YakindummPackage.TRANSITION__TARGET: return basicSetTarget(null, msgs); case YakindummPackage.TRANSITION__SOURCE: return basicSetSource(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { switch (eContainerFeatureID()) { case YakindummPackage.TRANSITION__SOURCE: return eInternalContainer().eInverseRemove(this, YakindummPackage.VERTEX__OUTGOING_TRANSITIONS, Vertex.class, msgs); } return super.eBasicRemoveFromContainerFeature(msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case YakindummPackage.TRANSITION__TARGET: if (resolve) return getTarget(); return basicGetTarget(); case YakindummPackage.TRANSITION__SOURCE: return getSource(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case YakindummPackage.TRANSITION__TARGET: setTarget((Vertex)newValue); return; case YakindummPackage.TRANSITION__SOURCE: setSource((Vertex)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case YakindummPackage.TRANSITION__TARGET: setTarget((Vertex)null); return; case YakindummPackage.TRANSITION__SOURCE: setSource((Vertex)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case YakindummPackage.TRANSITION__TARGET: return target != null; case YakindummPackage.TRANSITION__SOURCE: return getSource() != null; } return super.eIsSet(featureID); } } //TransitionImpl