| /******************************************************************************* |
| * Copyright (c) 2014, 2019 Willink Transformations and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ocl.xtext.essentialoclcs.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.util.EObjectEList; |
| import org.eclipse.ocl.xtext.basecs.impl.ModelElementCSImpl; |
| import org.eclipse.ocl.xtext.essentialoclcs.CallExpCS; |
| import org.eclipse.ocl.xtext.essentialoclcs.EssentialOCLCSPackage; |
| import org.eclipse.ocl.xtext.essentialoclcs.ExpCS; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Call Exp CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.ocl.xtext.essentialoclcs.impl.CallExpCSImpl#getArguments <em>Arguments</em>}</li> |
| * <li>{@link org.eclipse.ocl.xtext.essentialoclcs.impl.CallExpCSImpl#getSource <em>Source</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class CallExpCSImpl extends AbstractNameExpCSImpl implements CallExpCS |
| { |
| /** |
| * The number of structural features of the '<em>Call Exp CS</em>' class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| public static final int CALL_EXP_CS_FEATURE_COUNT = AbstractNameExpCSImpl.ABSTRACT_NAME_EXP_CS_FEATURE_COUNT + 2; |
| |
| /** |
| * The cached value of the '{@link #getArguments() <em>Arguments</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getArguments() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ExpCS> arguments; |
| |
| /** |
| * The cached value of the '{@link #getSource() <em>Source</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSource() |
| * @generated |
| * @ordered |
| */ |
| protected ExpCS source; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CallExpCSImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return EssentialOCLCSPackage.Literals.CALL_EXP_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ExpCS getSource() |
| { |
| return source; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setSource(ExpCS newSource) |
| { |
| ExpCS oldSource = source; |
| source = newSource; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 16, oldSource, source)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<ExpCS> getArguments() |
| { |
| if (arguments == null) |
| { |
| arguments = new EObjectEList<ExpCS>(ExpCS.class, this, ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 15); |
| } |
| return arguments; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 15: |
| return getArguments(); |
| case ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 16: |
| return getSource(); |
| } |
| 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 ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 15: |
| getArguments().clear(); |
| getArguments().addAll((Collection<? extends ExpCS>)newValue); |
| return; |
| case ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 16: |
| setSource((ExpCS)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 15: |
| getArguments().clear(); |
| return; |
| case ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 16: |
| setSource((ExpCS)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 15: |
| return arguments != null && !arguments.isEmpty(); |
| case ModelElementCSImpl.MODEL_ELEMENT_CS_FEATURE_COUNT + 16: |
| return source != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| |
| } //CallExpCSImpl |