blob: 3e87995a4b85b5241ac0bf98ee03f856a913cded [file] [log] [blame]
/**
* *******************************************************************************
* 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.RunnableConstraint;
import org.eclipse.app4mc.amalthea.model.RunnableConstraintTarget;
import org.eclipse.app4mc.amalthea.model.RunnableGroup;
import org.eclipse.app4mc.amalthea.model.RunnablePairingConstraint;
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>Runnable Pairing Constraint</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.RunnablePairingConstraintImpl#getTarget <em>Target</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.RunnablePairingConstraintImpl#getGroup <em>Group</em>}</li>
* </ul>
*
* @generated
*/
public class RunnablePairingConstraintImpl extends PairingConstraintImpl implements RunnablePairingConstraint {
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected RunnableConstraintTarget target;
/**
* The cached value of the '{@link #getGroup() <em>Group</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getGroup()
* @generated
* @ordered
*/
protected RunnableGroup group;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RunnablePairingConstraintImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getRunnablePairingConstraint();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RunnableConstraintTarget getTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTarget(RunnableConstraintTarget newTarget, NotificationChain msgs) {
RunnableConstraintTarget oldTarget = target;
target = newTarget;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUNNABLE_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(RunnableConstraintTarget newTarget) {
if (newTarget != target) {
NotificationChain msgs = null;
if (target != null)
msgs = ((InternalEObject)target).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__TARGET, null, msgs);
if (newTarget != null)
msgs = ((InternalEObject)newTarget).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__TARGET, null, msgs);
msgs = basicSetTarget(newTarget, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__TARGET, newTarget, newTarget));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RunnableGroup getGroup() {
return group;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetGroup(RunnableGroup newGroup, NotificationChain msgs) {
RunnableGroup oldGroup = group;
group = newGroup;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUNNABLE_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(RunnableGroup newGroup) {
if (newGroup != group) {
NotificationChain msgs = null;
if (group != null)
msgs = ((InternalEObject)group).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__GROUP, null, msgs);
if (newGroup != null)
msgs = ((InternalEObject)newGroup).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__GROUP, null, msgs);
msgs = basicSetGroup(newGroup, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUNNABLE_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.RUNNABLE_PAIRING_CONSTRAINT__TARGET:
return basicSetTarget(null, msgs);
case AmaltheaPackage.RUNNABLE_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.RUNNABLE_PAIRING_CONSTRAINT__TARGET:
return getTarget();
case AmaltheaPackage.RUNNABLE_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.RUNNABLE_PAIRING_CONSTRAINT__TARGET:
setTarget((RunnableConstraintTarget)newValue);
return;
case AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__GROUP:
setGroup((RunnableGroup)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__TARGET:
setTarget((RunnableConstraintTarget)null);
return;
case AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__GROUP:
setGroup((RunnableGroup)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__TARGET:
return target != null;
case AmaltheaPackage.RUNNABLE_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 == RunnableConstraint.class) {
switch (derivedFeatureID) {
case AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__TARGET: return AmaltheaPackage.RUNNABLE_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 == RunnableConstraint.class) {
switch (baseFeatureID) {
case AmaltheaPackage.RUNNABLE_CONSTRAINT__TARGET: return AmaltheaPackage.RUNNABLE_PAIRING_CONSTRAINT__TARGET;
default: return -1;
}
}
if (baseClass == BaseObject.class) {
switch (baseFeatureID) {
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
} //RunnablePairingConstraintImpl