| /** |
| * ******************************************************************************* |
| * Copyright (c) 2015-2021 Robert Bosch GmbH and others. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Generated using Eclipse EMF |
| * |
| * ******************************************************************************* |
| */ |
| package org.eclipse.app4mc.amalthea.model.impl; |
| |
| import org.eclipse.app4mc.amalthea.model.AmaltheaPackage; |
| import org.eclipse.app4mc.amalthea.model.BaseObject; |
| import org.eclipse.app4mc.amalthea.model.ProcessConstraint; |
| import org.eclipse.app4mc.amalthea.model.ProcessConstraintTarget; |
| import org.eclipse.app4mc.amalthea.model.ProcessGroup; |
| import org.eclipse.app4mc.amalthea.model.ProcessPairingConstraint; |
| |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Process Pairing Constraint</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.ProcessPairingConstraintImpl#getTarget <em>Target</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.ProcessPairingConstraintImpl#getGroup <em>Group</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ProcessPairingConstraintImpl extends PairingConstraintImpl implements ProcessPairingConstraint { |
| /** |
| * The cached value of the '{@link #getTarget() <em>Target</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTarget() |
| * @generated |
| * @ordered |
| */ |
| protected ProcessConstraintTarget target; |
| |
| /** |
| * The cached value of the '{@link #getGroup() <em>Group</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getGroup() |
| * @generated |
| * @ordered |
| */ |
| protected ProcessGroup group; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ProcessPairingConstraintImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getProcessPairingConstraint(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ProcessConstraintTarget getTarget() { |
| return target; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetTarget(ProcessConstraintTarget newTarget, NotificationChain msgs) { |
| ProcessConstraintTarget oldTarget = target; |
| target = newTarget; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET, oldTarget, newTarget); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setTarget(ProcessConstraintTarget newTarget) { |
| if (newTarget != target) { |
| NotificationChain msgs = null; |
| if (target != null) |
| msgs = ((InternalEObject)target).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET, null, msgs); |
| if (newTarget != null) |
| msgs = ((InternalEObject)newTarget).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET, null, msgs); |
| msgs = basicSetTarget(newTarget, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET, newTarget, newTarget)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ProcessGroup getGroup() { |
| return group; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetGroup(ProcessGroup newGroup, NotificationChain msgs) { |
| ProcessGroup oldGroup = group; |
| group = newGroup; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP, oldGroup, newGroup); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setGroup(ProcessGroup newGroup) { |
| if (newGroup != group) { |
| NotificationChain msgs = null; |
| if (group != null) |
| msgs = ((InternalEObject)group).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP, null, msgs); |
| if (newGroup != null) |
| msgs = ((InternalEObject)newGroup).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP, null, msgs); |
| msgs = basicSetGroup(newGroup, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP, newGroup, newGroup)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET: |
| return basicSetTarget(null, msgs); |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP: |
| return basicSetGroup(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 AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET: |
| return getTarget(); |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP: |
| return getGroup(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET: |
| setTarget((ProcessConstraintTarget)newValue); |
| return; |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP: |
| setGroup((ProcessGroup)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET: |
| setTarget((ProcessConstraintTarget)null); |
| return; |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP: |
| setGroup((ProcessGroup)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET: |
| return target != null; |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__GROUP: |
| return group != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == ProcessConstraint.class) { |
| switch (derivedFeatureID) { |
| case AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET: return AmaltheaPackage.PROCESS_CONSTRAINT__TARGET; |
| default: return -1; |
| } |
| } |
| if (baseClass == BaseObject.class) { |
| switch (derivedFeatureID) { |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == ProcessConstraint.class) { |
| switch (baseFeatureID) { |
| case AmaltheaPackage.PROCESS_CONSTRAINT__TARGET: return AmaltheaPackage.PROCESS_PAIRING_CONSTRAINT__TARGET; |
| default: return -1; |
| } |
| } |
| if (baseClass == BaseObject.class) { |
| switch (baseFeatureID) { |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| } //ProcessPairingConstraintImpl |