| /** |
| */ |
| package org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.NotificationChain; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| import org.eclipse.ocl.xtext.basecs.impl.PivotableElementCSImpl; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| import org.eclipse.ocl.xtext.essentialoclcs.ExpCS; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.OperationBodyCS; |
| 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 Body CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.OperationBodyCSImpl#getOwnedContentExps <em>Owned Content Exps</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class OperationBodyCSImpl extends PivotableElementCSImpl implements OperationBodyCS { |
| /** |
| * The cached value of the '{@link #getOwnedContentExps() <em>Owned Content Exps</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwnedContentExps() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ExpCS> ownedContentExps; |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected OperationBodyCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTOperationalCSPackage.Literals.OPERATION_BODY_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ExpCS> getOwnedContentExps() { |
| if (ownedContentExps == null) { |
| ownedContentExps = new EObjectContainmentEList<ExpCS>(ExpCS.class, this, QVTOperationalCSPackage.OPERATION_BODY_CS__OWNED_CONTENT_EXPS); |
| } |
| return ownedContentExps; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.OPERATION_BODY_CS__OWNED_CONTENT_EXPS: |
| return ((InternalEList<?>)getOwnedContentExps()).basicRemove(otherEnd, 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_BODY_CS__OWNED_CONTENT_EXPS: |
| return getOwnedContentExps(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.OPERATION_BODY_CS__OWNED_CONTENT_EXPS: |
| getOwnedContentExps().clear(); |
| getOwnedContentExps().addAll((Collection<? extends ExpCS>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.OPERATION_BODY_CS__OWNED_CONTENT_EXPS: |
| getOwnedContentExps().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.OPERATION_BODY_CS__OWNED_CONTENT_EXPS: |
| return ownedContentExps != null && !ownedContentExps.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(BaseCSVisitor<R> visitor) { |
| return (R) ((QVTOperationalCSVisitor<?>)visitor).visitOperationBodyCS(this); |
| } |
| |
| } //OperationBodyCSImpl |