blob: 83a3a6833132d9ecf8119635b73b2226fad38365 [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.OperationCSImpl;
import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.QVTOperationalCSPackage;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.QVToOperationCS;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.StereotypeQualifierCS;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.util.QVTOperationalCSVisitor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>QV To Operation CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.QVToOperationCSImpl#getStereotypes <em>Stereotypes</em>}</li>
* </ul>
*
* @generated
*/
public class QVToOperationCSImpl extends OperationCSImpl implements QVToOperationCS {
/**
* The cached value of the '{@link #getStereotypes() <em>Stereotypes</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStereotypes()
* @generated
* @ordered
*/
protected StereotypeQualifierCS stereotypes;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected QVToOperationCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QVTOperationalCSPackage.Literals.QV_TO_OPERATION_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StereotypeQualifierCS getStereotypes() {
return stereotypes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStereotypes(StereotypeQualifierCS newStereotypes, NotificationChain msgs) {
StereotypeQualifierCS oldStereotypes = stereotypes;
stereotypes = newStereotypes;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.QV_TO_OPERATION_CS__STEREOTYPES, oldStereotypes, newStereotypes);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStereotypes(StereotypeQualifierCS newStereotypes) {
if (newStereotypes != stereotypes) {
NotificationChain msgs = null;
if (stereotypes != null)
msgs = ((InternalEObject)stereotypes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.QV_TO_OPERATION_CS__STEREOTYPES, null, msgs);
if (newStereotypes != null)
msgs = ((InternalEObject)newStereotypes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.QV_TO_OPERATION_CS__STEREOTYPES, null, msgs);
msgs = basicSetStereotypes(newStereotypes, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.QV_TO_OPERATION_CS__STEREOTYPES, newStereotypes, newStereotypes));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case QVTOperationalCSPackage.QV_TO_OPERATION_CS__STEREOTYPES:
return basicSetStereotypes(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.QV_TO_OPERATION_CS__STEREOTYPES:
return getStereotypes();
}
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.QV_TO_OPERATION_CS__STEREOTYPES:
setStereotypes((StereotypeQualifierCS)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case QVTOperationalCSPackage.QV_TO_OPERATION_CS__STEREOTYPES:
setStereotypes((StereotypeQualifierCS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case QVTOperationalCSPackage.QV_TO_OPERATION_CS__STEREOTYPES:
return stereotypes != null;
}
return super.eIsSet(featureID);
}
/**
* {@inheritDoc}
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public <R> R accept(BaseCSVisitor<R> visitor) {
return (R) ((QVTOperationalCSVisitor<?>)visitor).visitQVToOperationCS(this);
}
} //QVToOperationCSImpl