| /** |
| * Copyright (c) 2017 CEA. |
| * 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: |
| * CEA - initial API and implementation and/or initial documentation |
| */ |
| /** |
| * generated by Xtext 2.9.1 |
| */ |
| package org.eclipse.sensinact.studio.language.sensinact.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.MinimalEObjectImpl; |
| |
| import org.eclipse.sensinact.studio.language.sensinact.DSL_SENSINACT; |
| import org.eclipse.sensinact.studio.language.sensinact.Sensinact; |
| import org.eclipse.sensinact.studio.language.sensinact.SensinactPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Sensinact</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.sensinact.studio.language.sensinact.impl.SensinactImpl#getEca <em>Eca</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class SensinactImpl extends MinimalEObjectImpl.Container implements Sensinact |
| { |
| /** |
| * The cached value of the '{@link #getEca() <em>Eca</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEca() |
| * @generated |
| * @ordered |
| */ |
| protected DSL_SENSINACT eca; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SensinactImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return SensinactPackage.Literals.SENSINACT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DSL_SENSINACT getEca() |
| { |
| return eca; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetEca(DSL_SENSINACT newEca, NotificationChain msgs) |
| { |
| DSL_SENSINACT oldEca = eca; |
| eca = newEca; |
| if (eNotificationRequired()) |
| { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SensinactPackage.SENSINACT__ECA, oldEca, newEca); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEca(DSL_SENSINACT newEca) |
| { |
| if (newEca != eca) |
| { |
| NotificationChain msgs = null; |
| if (eca != null) |
| msgs = ((InternalEObject)eca).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SensinactPackage.SENSINACT__ECA, null, msgs); |
| if (newEca != null) |
| msgs = ((InternalEObject)newEca).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SensinactPackage.SENSINACT__ECA, null, msgs); |
| msgs = basicSetEca(newEca, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SensinactPackage.SENSINACT__ECA, newEca, newEca)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case SensinactPackage.SENSINACT__ECA: |
| return basicSetEca(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 SensinactPackage.SENSINACT__ECA: |
| return getEca(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case SensinactPackage.SENSINACT__ECA: |
| setEca((DSL_SENSINACT)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case SensinactPackage.SENSINACT__ECA: |
| setEca((DSL_SENSINACT)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case SensinactPackage.SENSINACT__ECA: |
| return eca != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //SensinactImpl |