| /** |
| * Copyright (c) 2016 ALL4TEC & 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: |
| * ALL4TEC & CEA LIST - initial API and implementation |
| */ |
| package org.polarsys.esf.esffmea.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.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.polarsys.esf.esfcore.impl.AbstractSSafetyAnalysis; |
| |
| import org.polarsys.esf.esffmea.IESFFMEAPackage; |
| import org.polarsys.esf.esffmea.ISBlockFMEA; |
| import org.polarsys.esf.esffmea.ISFMEA; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>SFMEA</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.polarsys.esf.esffmea.impl.SFMEA#getBase_Package <em>Base Package</em>}</li> |
| * <li>{@link org.polarsys.esf.esffmea.impl.SFMEA#getSBlocksFMEAList <em>SBlocks FMEA List</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class SFMEA extends AbstractSSafetyAnalysis implements ISFMEA { |
| /** |
| * The cached value of the '{@link #getBase_Package() <em>Base Package</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Package() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.uml2.uml.Package base_Package; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SFMEA() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return IESFFMEAPackage.Literals.SFMEA; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.uml2.uml.Package getBase_Package() { |
| if (base_Package != null && base_Package.eIsProxy()) { |
| InternalEObject oldBase_Package = (InternalEObject)base_Package; |
| base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); |
| if (base_Package != oldBase_Package) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, IESFFMEAPackage.SFMEA__BASE_PACKAGE, oldBase_Package, base_Package)); |
| } |
| } |
| return base_Package; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.uml2.uml.Package basicGetBase_Package() { |
| return base_Package; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { |
| org.eclipse.uml2.uml.Package oldBase_Package = base_Package; |
| base_Package = newBase_Package; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, IESFFMEAPackage.SFMEA__BASE_PACKAGE, oldBase_Package, base_Package)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ISBlockFMEA> getSBlocksFMEAList() { |
| // TODO: implement this method to return the 'SBlocks FMEA List' reference list |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case IESFFMEAPackage.SFMEA__BASE_PACKAGE: |
| if (resolve) return getBase_Package(); |
| return basicGetBase_Package(); |
| case IESFFMEAPackage.SFMEA__SBLOCKS_FMEA_LIST: |
| return getSBlocksFMEAList(); |
| } |
| 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 IESFFMEAPackage.SFMEA__BASE_PACKAGE: |
| setBase_Package((org.eclipse.uml2.uml.Package)newValue); |
| return; |
| case IESFFMEAPackage.SFMEA__SBLOCKS_FMEA_LIST: |
| getSBlocksFMEAList().clear(); |
| getSBlocksFMEAList().addAll((Collection<? extends ISBlockFMEA>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case IESFFMEAPackage.SFMEA__BASE_PACKAGE: |
| setBase_Package((org.eclipse.uml2.uml.Package)null); |
| return; |
| case IESFFMEAPackage.SFMEA__SBLOCKS_FMEA_LIST: |
| getSBlocksFMEAList().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case IESFFMEAPackage.SFMEA__BASE_PACKAGE: |
| return base_Package != null; |
| case IESFFMEAPackage.SFMEA__SBLOCKS_FMEA_LIST: |
| return !getSBlocksFMEAList().isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //SFMEA |