blob: 7c4614d34d9af23733da7f9f5efe5b083b3801c5 [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 org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.ArchitectureRequirement;
import org.eclipse.app4mc.amalthea.model.Component;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Architecture Requirement</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ArchitectureRequirementImpl#getComponent <em>Component</em>}</li>
* </ul>
*
* @generated
*/
public class ArchitectureRequirementImpl extends RequirementImpl implements ArchitectureRequirement {
/**
* The cached value of the '{@link #getComponent() <em>Component</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getComponent()
* @generated
* @ordered
*/
protected Component component;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ArchitectureRequirementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getArchitectureRequirement();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Component getComponent() {
if (component != null && component.eIsProxy()) {
InternalEObject oldComponent = (InternalEObject)component;
component = (Component)eResolveProxy(oldComponent);
if (component != oldComponent) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.ARCHITECTURE_REQUIREMENT__COMPONENT, oldComponent, component));
}
}
return component;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Component basicGetComponent() {
return component;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setComponent(Component newComponent) {
Component oldComponent = component;
component = newComponent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ARCHITECTURE_REQUIREMENT__COMPONENT, oldComponent, component));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.ARCHITECTURE_REQUIREMENT__COMPONENT:
if (resolve) return getComponent();
return basicGetComponent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.ARCHITECTURE_REQUIREMENT__COMPONENT:
setComponent((Component)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.ARCHITECTURE_REQUIREMENT__COMPONENT:
setComponent((Component)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.ARCHITECTURE_REQUIREMENT__COMPONENT:
return component != null;
}
return super.eIsSet(featureID);
}
} //ArchitectureRequirementImpl