| /** |
| * **************************************************************************** |
| * Copyright (c) 2020 CEA LIST. |
| * |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Asma Smaoui (CEA LIST) asma.smaoui@cea.fr - Initial API and implementation |
| * |
| * **************************************************************************** |
| */ |
| package io.shell.admin.aas._1._0.impl; |
| |
| import io.shell.admin.aas._1._0.ConstraintT; |
| import io.shell.admin.aas._1._0.FormulaT; |
| import io.shell.admin.aas._1._0.QualifierT; |
| import io.shell.admin.aas._1._0._0Package; |
| |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Constraint T</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link io.shell.admin.aas._1._0.impl.ConstraintTImpl#getQualifier <em>Qualifier</em>}</li> |
| * <li>{@link io.shell.admin.aas._1._0.impl.ConstraintTImpl#getFormula <em>Formula</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ConstraintTImpl extends MinimalEObjectImpl.Container implements ConstraintT { |
| /** |
| * The cached value of the '{@link #getQualifier() <em>Qualifier</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getQualifier() |
| * @generated |
| * @ordered |
| */ |
| protected QualifierT qualifier; |
| |
| /** |
| * The cached value of the '{@link #getFormula() <em>Formula</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFormula() |
| * @generated |
| * @ordered |
| */ |
| protected FormulaT formula; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ConstraintTImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return _0Package.Literals.CONSTRAINT_T; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public QualifierT getQualifier() { |
| return qualifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetQualifier(QualifierT newQualifier, NotificationChain msgs) { |
| QualifierT oldQualifier = qualifier; |
| qualifier = newQualifier; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _0Package.CONSTRAINT_T__QUALIFIER, oldQualifier, newQualifier); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setQualifier(QualifierT newQualifier) { |
| if (newQualifier != qualifier) { |
| NotificationChain msgs = null; |
| if (qualifier != null) |
| msgs = ((InternalEObject)qualifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - _0Package.CONSTRAINT_T__QUALIFIER, null, msgs); |
| if (newQualifier != null) |
| msgs = ((InternalEObject)newQualifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - _0Package.CONSTRAINT_T__QUALIFIER, null, msgs); |
| msgs = basicSetQualifier(newQualifier, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, _0Package.CONSTRAINT_T__QUALIFIER, newQualifier, newQualifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FormulaT getFormula() { |
| return formula; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetFormula(FormulaT newFormula, NotificationChain msgs) { |
| FormulaT oldFormula = formula; |
| formula = newFormula; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _0Package.CONSTRAINT_T__FORMULA, oldFormula, newFormula); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFormula(FormulaT newFormula) { |
| if (newFormula != formula) { |
| NotificationChain msgs = null; |
| if (formula != null) |
| msgs = ((InternalEObject)formula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - _0Package.CONSTRAINT_T__FORMULA, null, msgs); |
| if (newFormula != null) |
| msgs = ((InternalEObject)newFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - _0Package.CONSTRAINT_T__FORMULA, null, msgs); |
| msgs = basicSetFormula(newFormula, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, _0Package.CONSTRAINT_T__FORMULA, newFormula, newFormula)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case _0Package.CONSTRAINT_T__QUALIFIER: |
| return basicSetQualifier(null, msgs); |
| case _0Package.CONSTRAINT_T__FORMULA: |
| return basicSetFormula(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 _0Package.CONSTRAINT_T__QUALIFIER: |
| return getQualifier(); |
| case _0Package.CONSTRAINT_T__FORMULA: |
| return getFormula(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case _0Package.CONSTRAINT_T__QUALIFIER: |
| setQualifier((QualifierT)newValue); |
| return; |
| case _0Package.CONSTRAINT_T__FORMULA: |
| setFormula((FormulaT)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case _0Package.CONSTRAINT_T__QUALIFIER: |
| setQualifier((QualifierT)null); |
| return; |
| case _0Package.CONSTRAINT_T__FORMULA: |
| setFormula((FormulaT)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case _0Package.CONSTRAINT_T__QUALIFIER: |
| return qualifier != null; |
| case _0Package.CONSTRAINT_T__FORMULA: |
| return formula != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ConstraintTImpl |