| /***************************************************************************** |
| * Copyright (c) 2020 CEA LIST. |
| * |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Saadia Dhouib (CEA LIST) saadia.dhouib@cea.fr - Initial API and implementation |
| * |
| *****************************************************************************/ |
| package org.eclipse.papyrus.aas.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.aas.AASPackage; |
| import org.eclipse.papyrus.aas.Operation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Operation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aas.impl.OperationImpl#getBase_Operation <em>Base Operation</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aas.impl.OperationImpl#getIdShort <em>Id Short</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class OperationImpl extends SubmodelElementImpl implements Operation { |
| /** |
| * The cached value of the '{@link #getBase_Operation() <em>Base Operation</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getBase_Operation() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.uml2.uml.Operation base_Operation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected OperationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AASPackage.Literals.OPERATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public org.eclipse.uml2.uml.Operation getBase_Operation() { |
| if (base_Operation != null && base_Operation.eIsProxy()) { |
| InternalEObject oldBase_Operation = (InternalEObject) base_Operation; |
| base_Operation = (org.eclipse.uml2.uml.Operation) eResolveProxy(oldBase_Operation); |
| if (base_Operation != oldBase_Operation) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AASPackage.OPERATION__BASE_OPERATION, oldBase_Operation, base_Operation)); |
| } |
| } |
| return base_Operation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public org.eclipse.uml2.uml.Operation basicGetBase_Operation() { |
| return base_Operation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setBase_Operation(org.eclipse.uml2.uml.Operation newBase_Operation) { |
| org.eclipse.uml2.uml.Operation oldBase_Operation = base_Operation; |
| base_Operation = newBase_Operation; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AASPackage.OPERATION__BASE_OPERATION, oldBase_Operation, base_Operation)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String getIdShort() { |
| // get the name of the Referable Element |
| if (getBase_Operation() != null) { |
| String name = getBase_Operation().getName(); |
| // remove space |
| if (name != null) { |
| String idShort = name.toLowerCase().replace(" ", ""); |
| return idShort; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public boolean isSetIdShort() { |
| return ID_SHORT_EDEFAULT == null ? getIdShort() != null : !ID_SHORT_EDEFAULT.equals(getIdShort()); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AASPackage.OPERATION__BASE_OPERATION: |
| if (resolve) |
| return getBase_Operation(); |
| return basicGetBase_Operation(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case AASPackage.OPERATION__BASE_OPERATION: |
| setBase_Operation((org.eclipse.uml2.uml.Operation) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AASPackage.OPERATION__BASE_OPERATION: |
| setBase_Operation((org.eclipse.uml2.uml.Operation) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AASPackage.OPERATION__BASE_OPERATION: |
| return base_Operation != null; |
| case AASPackage.OPERATION__ID_SHORT: |
| return isSetIdShort(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // OperationImpl |