| /** |
| */ |
| package org.eclipse.qvto.examples.xtext.imperativeoclcs.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.util.BaseCSVisitor; |
| import org.eclipse.ocl.xtext.essentialoclcs.CollectionLiteralPartCS; |
| import org.eclipse.ocl.xtext.essentialoclcs.impl.LiteralExpCSImpl; |
| import org.eclipse.qvto.examples.xtext.imperativeoclcs.ImperativeOCLCSPackage; |
| import org.eclipse.qvto.examples.xtext.imperativeoclcs.ListLiteralExpCS; |
| import org.eclipse.qvto.examples.xtext.imperativeoclcs.util.ImperativeOCLCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>List Literal Exp CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvto.examples.xtext.imperativeoclcs.impl.ListLiteralExpCSImpl#getOwnedParts <em>Owned Parts</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ListLiteralExpCSImpl extends LiteralExpCSImpl implements ListLiteralExpCS { |
| /** |
| * The cached value of the '{@link #getOwnedParts() <em>Owned Parts</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwnedParts() |
| * @generated |
| * @ordered |
| */ |
| protected EList<CollectionLiteralPartCS> ownedParts; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ListLiteralExpCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ImperativeOCLCSPackage.Literals.LIST_LITERAL_EXP_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<CollectionLiteralPartCS> getOwnedParts() { |
| if (ownedParts == null) { |
| ownedParts = new EObjectContainmentEList<CollectionLiteralPartCS>(CollectionLiteralPartCS.class, this, ImperativeOCLCSPackage.LIST_LITERAL_EXP_CS__OWNED_PARTS); |
| } |
| return ownedParts; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ImperativeOCLCSPackage.LIST_LITERAL_EXP_CS__OWNED_PARTS: |
| return ((InternalEList<?>)getOwnedParts()).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 ImperativeOCLCSPackage.LIST_LITERAL_EXP_CS__OWNED_PARTS: |
| return getOwnedParts(); |
| } |
| 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 ImperativeOCLCSPackage.LIST_LITERAL_EXP_CS__OWNED_PARTS: |
| getOwnedParts().clear(); |
| getOwnedParts().addAll((Collection<? extends CollectionLiteralPartCS>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ImperativeOCLCSPackage.LIST_LITERAL_EXP_CS__OWNED_PARTS: |
| getOwnedParts().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ImperativeOCLCSPackage.LIST_LITERAL_EXP_CS__OWNED_PARTS: |
| return ownedParts != null && !ownedParts.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(BaseCSVisitor<R> visitor) { |
| return (R) ((ImperativeOCLCSVisitor<?>)visitor).visitListLiteralExpCS(this); |
| } |
| |
| } //ListLiteralExpCSImpl |