blob: a9f02f744436c2f8d2efa984327ad877cd0aa9c0 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.impl;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.ComponentInterface;
import org.eclipse.app4mc.amalthea.model.INamed;
import org.eclipse.app4mc.amalthea.model.IReferable;
import org.eclipse.app4mc.amalthea.model.ReferableBaseObject;
import org.eclipse.app4mc.amalthea.model.SubInterface;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.xcore.lib.XcoreCollectionLiterals;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Sub Interface</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.SubInterfaceImpl#getContainingInterface <em>Containing Interface</em>}</li>
* </ul>
*
* @generated
*/
public class SubInterfaceImpl extends ComponentInterfaceImpl implements SubInterface {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SubInterfaceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getSubInterface();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ComponentInterface getContainingInterface() {
if (eContainerFeatureID() != AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE) return null;
return (ComponentInterface)eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComponentInterface basicGetContainingInterface() {
if (eContainerFeatureID() != AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE) return null;
return (ComponentInterface)eInternalContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getNamePrefixSegments() {
EList<String> _elvis = null;
ComponentInterface _containingInterface = this.getContainingInterface();
EList<String> _qualifiedNameSegments = null;
if (_containingInterface!=null) {
_qualifiedNameSegments=_containingInterface.getQualifiedNameSegments();
}
if (_qualifiedNameSegments != null) {
_elvis = _qualifiedNameSegments;
} else {
BasicEList<String> _newBasicEList = XcoreCollectionLiterals.<String>newBasicEList();
_elvis = _newBasicEList;
}
return _elvis;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return eBasicSetContainer(otherEnd, AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE:
return eBasicSetContainer(null, AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE:
return eInternalContainer().eInverseRemove(this, AmaltheaPackage.COMPONENT_INTERFACE__SUB_INTERFACES, ComponentInterface.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE:
if (resolve) return getContainingInterface();
return basicGetContainingInterface();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.SUB_INTERFACE__CONTAINING_INTERFACE:
return basicGetContainingInterface() != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) {
if (baseClass == INamed.class) {
switch (baseOperationID) {
case AmaltheaPackage.INAMED___GET_NAME_PREFIX_SEGMENTS: return AmaltheaPackage.SUB_INTERFACE___GET_NAME_PREFIX_SEGMENTS;
default: return super.eDerivedOperationID(baseOperationID, baseClass);
}
}
if (baseClass == IReferable.class) {
switch (baseOperationID) {
case AmaltheaPackage.IREFERABLE___GET_NAME_PREFIX_SEGMENTS: return AmaltheaPackage.SUB_INTERFACE___GET_NAME_PREFIX_SEGMENTS;
default: return super.eDerivedOperationID(baseOperationID, baseClass);
}
}
if (baseClass == ReferableBaseObject.class) {
switch (baseOperationID) {
case AmaltheaPackage.REFERABLE_BASE_OBJECT___GET_NAME_PREFIX_SEGMENTS: return AmaltheaPackage.SUB_INTERFACE___GET_NAME_PREFIX_SEGMENTS;
default: return super.eDerivedOperationID(baseOperationID, baseClass);
}
}
return super.eDerivedOperationID(baseOperationID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case AmaltheaPackage.SUB_INTERFACE___GET_NAME_PREFIX_SEGMENTS:
return getNamePrefixSegments();
}
return super.eInvoke(operationID, arguments);
}
} //SubInterfaceImpl