blob: c6e75c157153960c156c48b396707af114e6c82f [file] [log] [blame]
/**
*/
package org.eclipse.qvto.examples.xtext.qvtoperationalcs.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.ocl.xtext.basecs.impl.ElementRefCSImpl;
import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.OperationRefCS;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.PathName2CS;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.QVTOperationalCSPackage;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.util.QVTOperationalCSVisitor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Operation Ref CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.OperationRefCSImpl#getOwnedPathName <em>Owned Path Name</em>}</li>
* </ul>
*
* @generated
*/
public class OperationRefCSImpl extends ElementRefCSImpl implements OperationRefCS {
/**
* The cached value of the '{@link #getOwnedPathName() <em>Owned Path Name</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedPathName()
* @generated
* @ordered
*/
protected PathName2CS ownedPathName;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected OperationRefCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QVTOperationalCSPackage.Literals.OPERATION_REF_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PathName2CS getOwnedPathName() {
return ownedPathName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOwnedPathName(PathName2CS newOwnedPathName, NotificationChain msgs) {
PathName2CS oldOwnedPathName = ownedPathName;
ownedPathName = newOwnedPathName;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME, oldOwnedPathName, newOwnedPathName);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwnedPathName(PathName2CS newOwnedPathName) {
if (newOwnedPathName != ownedPathName) {
NotificationChain msgs = null;
if (ownedPathName != null)
msgs = ((InternalEObject)ownedPathName).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME, null, msgs);
if (newOwnedPathName != null)
msgs = ((InternalEObject)newOwnedPathName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME, null, msgs);
msgs = basicSetOwnedPathName(newOwnedPathName, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME, newOwnedPathName, newOwnedPathName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME:
return basicSetOwnedPathName(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 QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME:
return getOwnedPathName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME:
setOwnedPathName((PathName2CS)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME:
setOwnedPathName((PathName2CS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case QVTOperationalCSPackage.OPERATION_REF_CS__OWNED_PATH_NAME:
return ownedPathName != null;
}
return super.eIsSet(featureID);
}
/**
* {@inheritDoc}
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public <R> R accept(BaseCSVisitor<R> visitor) {
return (R) ((QVTOperationalCSVisitor<?>)visitor).visitOperationRefCS(this);
}
} //OperationRefCSImpl