/** * Copyright (c) 2015 committers of YAKINDU and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * Contributors: * committers of YAKINDU - initial API and implementation * */ package org.yakindu.sct.model.sexec.impl; 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.EObjectImpl; import org.yakindu.sct.model.sexec.ExecutionState; import org.yakindu.sct.model.sexec.SexecPackage; import org.yakindu.sct.model.sexec.StateCase; import org.yakindu.sct.model.sexec.Step; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>State Case</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.yakindu.sct.model.sexec.impl.StateCaseImpl#getState <em>State</em>}</li> * <li>{@link org.yakindu.sct.model.sexec.impl.StateCaseImpl#getStep <em>Step</em>}</li> * </ul> * * @generated */ public class StateCaseImpl extends EObjectImpl implements StateCase { /** * The cached value of the '{@link #getState() <em>State</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getState() * @generated * @ordered */ protected ExecutionState state; /** * The cached value of the '{@link #getStep() <em>Step</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getStep() * @generated * @ordered */ protected Step step; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected StateCaseImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return SexecPackage.Literals.STATE_CASE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ExecutionState getState() { if (state != null && state.eIsProxy()) { InternalEObject oldState = (InternalEObject)state; state = (ExecutionState)eResolveProxy(oldState); if (state != oldState) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.STATE_CASE__STATE, oldState, state)); } } return state; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ExecutionState basicGetState() { return state; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setState(ExecutionState newState) { ExecutionState oldState = state; state = newState; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.STATE_CASE__STATE, oldState, state)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Step getStep() { return step; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetStep(Step newStep, NotificationChain msgs) { Step oldStep = step; step = newStep; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.STATE_CASE__STEP, oldStep, newStep); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setStep(Step newStep) { if (newStep != step) { NotificationChain msgs = null; if (step != null) msgs = ((InternalEObject)step).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SexecPackage.STATE_CASE__STEP, null, msgs); if (newStep != null) msgs = ((InternalEObject)newStep).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SexecPackage.STATE_CASE__STEP, null, msgs); msgs = basicSetStep(newStep, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.STATE_CASE__STEP, newStep, newStep)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SexecPackage.STATE_CASE__STEP: return basicSetStep(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SexecPackage.STATE_CASE__STATE: if (resolve) return getState(); return basicGetState(); case SexecPackage.STATE_CASE__STEP: return getStep(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SexecPackage.STATE_CASE__STATE: setState((ExecutionState)newValue); return; case SexecPackage.STATE_CASE__STEP: setStep((Step)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SexecPackage.STATE_CASE__STATE: setState((ExecutionState)null); return; case SexecPackage.STATE_CASE__STEP: setStep((Step)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SexecPackage.STATE_CASE__STATE: return state != null; case SexecPackage.STATE_CASE__STEP: return step != null; } return super.eIsSet(featureID); } } //StateCaseImpl