/** * Copyright (c) 2013 itemis AG 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: * itemis AG - initial API and implementation * */ package org.eclipse.rmf.tests.serialization.env.emf.myreqif.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.eclipse.rmf.tests.serialization.env.emf.myreqif.ATTRIBUTEVALUEENUMERATION; import org.eclipse.rmf.tests.serialization.env.emf.myreqif.DEFINITIONType; import org.eclipse.rmf.tests.serialization.env.emf.myreqif.MyreqifPackage; import org.eclipse.rmf.tests.serialization.env.emf.myreqif.VALUESType3; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>ATTRIBUTEVALUEENUMERATION</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.ATTRIBUTEVALUEENUMERATIONImpl#getDEFINITION <em>DEFINITION</em>}</li> * <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.ATTRIBUTEVALUEENUMERATIONImpl#getVALUES <em>VALUES</em>}</li> * </ul> * </p> * * @generated */ public class ATTRIBUTEVALUEENUMERATIONImpl extends EObjectImpl implements ATTRIBUTEVALUEENUMERATION { /** * The cached value of the '{@link #getDEFINITION() <em>DEFINITION</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDEFINITION() * @generated * @ordered */ protected DEFINITIONType dEFINITION; /** * The cached value of the '{@link #getVALUES() <em>VALUES</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getVALUES() * @generated * @ordered */ protected VALUESType3 vALUES; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ATTRIBUTEVALUEENUMERATIONImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return MyreqifPackage.Literals.ATTRIBUTEVALUEENUMERATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DEFINITIONType getDEFINITION() { return dEFINITION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetDEFINITION(DEFINITIONType newDEFINITION, NotificationChain msgs) { DEFINITIONType oldDEFINITION = dEFINITION; dEFINITION = newDEFINITION; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION, oldDEFINITION, newDEFINITION); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDEFINITION(DEFINITIONType newDEFINITION) { if (newDEFINITION != dEFINITION) { NotificationChain msgs = null; if (dEFINITION != null) msgs = ((InternalEObject)dEFINITION).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION, null, msgs); if (newDEFINITION != null) msgs = ((InternalEObject)newDEFINITION).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION, null, msgs); msgs = basicSetDEFINITION(newDEFINITION, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION, newDEFINITION, newDEFINITION)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public VALUESType3 getVALUES() { return vALUES; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetVALUES(VALUESType3 newVALUES, NotificationChain msgs) { VALUESType3 oldVALUES = vALUES; vALUES = newVALUES; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES, oldVALUES, newVALUES); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setVALUES(VALUESType3 newVALUES) { if (newVALUES != vALUES) { NotificationChain msgs = null; if (vALUES != null) msgs = ((InternalEObject)vALUES).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES, null, msgs); if (newVALUES != null) msgs = ((InternalEObject)newVALUES).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES, null, msgs); msgs = basicSetVALUES(newVALUES, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES, newVALUES, newVALUES)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION: return basicSetDEFINITION(null, msgs); case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES: return basicSetVALUES(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 MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION: return getDEFINITION(); case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES: return getVALUES(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION: setDEFINITION((DEFINITIONType)newValue); return; case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES: setVALUES((VALUESType3)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION: setDEFINITION((DEFINITIONType)null); return; case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES: setVALUES((VALUESType3)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__DEFINITION: return dEFINITION != null; case MyreqifPackage.ATTRIBUTEVALUEENUMERATION__VALUES: return vALUES != null; } return super.eIsSet(featureID); } } //ATTRIBUTEVALUEENUMERATIONImpl