| /** |
| * Copyright (c) 2016 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: |
| * CEA LIST - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.moka.fmi.modeldescription.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.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.BasicFeatureMap; |
| import org.eclipse.emf.ecore.util.FeatureMap; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.papyrus.moka.fmi.modeldescription.Fmi2VariableDependency; |
| import org.eclipse.papyrus.moka.fmi.modeldescription.FmiPackage; |
| import org.eclipse.papyrus.moka.fmi.modeldescription.UnknownType1; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Fmi2 Variable Dependency</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.moka.fmi.modeldescription.impl.Fmi2VariableDependencyImpl#getGroup <em>Group</em>}</li> |
| * <li>{@link org.eclipse.papyrus.moka.fmi.modeldescription.impl.Fmi2VariableDependencyImpl#getUnknown <em>Unknown</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class Fmi2VariableDependencyImpl extends MinimalEObjectImpl.Container implements Fmi2VariableDependency { |
| /** |
| * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getGroup() |
| * @generated |
| * @ordered |
| */ |
| protected FeatureMap group; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected Fmi2VariableDependencyImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FmiPackage.Literals.FMI2_VARIABLE_DEPENDENCY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public FeatureMap getGroup() { |
| if (group == null) { |
| group = new BasicFeatureMap(this, FmiPackage.FMI2_VARIABLE_DEPENDENCY__GROUP); |
| } |
| return group; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<UnknownType1> getUnknown() { |
| return getGroup().list(FmiPackage.Literals.FMI2_VARIABLE_DEPENDENCY__UNKNOWN); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__GROUP: |
| return ((InternalEList<?>)getGroup()).basicRemove(otherEnd, msgs); |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__UNKNOWN: |
| return ((InternalEList<?>)getUnknown()).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 FmiPackage.FMI2_VARIABLE_DEPENDENCY__GROUP: |
| if (coreType) return getGroup(); |
| return ((FeatureMap.Internal)getGroup()).getWrapper(); |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__UNKNOWN: |
| return getUnknown(); |
| } |
| 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 FmiPackage.FMI2_VARIABLE_DEPENDENCY__GROUP: |
| ((FeatureMap.Internal)getGroup()).set(newValue); |
| return; |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__UNKNOWN: |
| getUnknown().clear(); |
| getUnknown().addAll((Collection<? extends UnknownType1>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__GROUP: |
| getGroup().clear(); |
| return; |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__UNKNOWN: |
| getUnknown().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__GROUP: |
| return group != null && !group.isEmpty(); |
| case FmiPackage.FMI2_VARIABLE_DEPENDENCY__UNKNOWN: |
| return !getUnknown().isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (group: "); |
| result.append(group); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //Fmi2VariableDependencyImpl |