blob: 85465b68ba068cd6640a00957cd770cd6ce218f3 [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.NumericStatistic;
import org.eclipse.app4mc.amalthea.model.RunEntityCallStatistic;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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>Run Entity Call Statistic</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.RunEntityCallStatisticImpl#getStatistic <em>Statistic</em>}</li>
* </ul>
*
* @generated
*/
public class RunEntityCallStatisticImpl extends BaseObjectImpl implements RunEntityCallStatistic {
/**
* The cached value of the '{@link #getStatistic() <em>Statistic</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStatistic()
* @generated
* @ordered
*/
protected NumericStatistic statistic;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RunEntityCallStatisticImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getRunEntityCallStatistic();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NumericStatistic getStatistic() {
return statistic;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStatistic(NumericStatistic newStatistic, NotificationChain msgs) {
NumericStatistic oldStatistic = statistic;
statistic = newStatistic;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC, oldStatistic, newStatistic);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setStatistic(NumericStatistic newStatistic) {
if (newStatistic != statistic) {
NotificationChain msgs = null;
if (statistic != null)
msgs = ((InternalEObject)statistic).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC, null, msgs);
if (newStatistic != null)
msgs = ((InternalEObject)newStatistic).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC, null, msgs);
msgs = basicSetStatistic(newStatistic, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC, newStatistic, newStatistic));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC:
return basicSetStatistic(null, 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 AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC:
return getStatistic();
}
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.RUN_ENTITY_CALL_STATISTIC__STATISTIC:
setStatistic((NumericStatistic)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC:
setStatistic((NumericStatistic)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.RUN_ENTITY_CALL_STATISTIC__STATISTIC:
return statistic != null;
}
return super.eIsSet(featureID);
}
} //RunEntityCallStatisticImpl