blob: a941551505a3818b3e508bf68a66352985f52ea5 [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.AmaltheaIndex;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.Counter;
import org.eclipse.app4mc.amalthea.model.InterProcessStimulus;
import org.eclipse.app4mc.amalthea.model.InterProcessTrigger;
import org.eclipse.emf.common.notify.Notification;
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.EReference;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Inter Process Stimulus</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.InterProcessStimulusImpl#getCounter <em>Counter</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.InterProcessStimulusImpl#getExplicitTriggers <em>Explicit Triggers</em>}</li>
* </ul>
*
* @generated
*/
public class InterProcessStimulusImpl extends StimulusImpl implements InterProcessStimulus {
/**
* The cached value of the '{@link #getCounter() <em>Counter</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCounter()
* @generated
* @ordered
*/
protected Counter counter;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InterProcessStimulusImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getInterProcessStimulus();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Counter getCounter() {
return counter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCounter(Counter newCounter, NotificationChain msgs) {
Counter oldCounter = counter;
counter = newCounter;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.INTER_PROCESS_STIMULUS__COUNTER, oldCounter, newCounter);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setCounter(Counter newCounter) {
if (newCounter != counter) {
NotificationChain msgs = null;
if (counter != null)
msgs = ((InternalEObject)counter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.INTER_PROCESS_STIMULUS__COUNTER, null, msgs);
if (newCounter != null)
msgs = ((InternalEObject)newCounter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.INTER_PROCESS_STIMULUS__COUNTER, null, msgs);
msgs = basicSetCounter(newCounter, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.INTER_PROCESS_STIMULUS__COUNTER, newCounter, newCounter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<InterProcessTrigger> getExplicitTriggers() {
EReference _interProcessTrigger_Stimulus = AmaltheaPackage.eINSTANCE.getInterProcessTrigger_Stimulus();
return AmaltheaIndex.<InterProcessTrigger>getInverseReferences(this, AmaltheaPackage.eINSTANCE.getInterProcessStimulus_ExplicitTriggers(),
java.util.Collections.<EReference>unmodifiableSet(org.eclipse.xtext.xbase.lib.CollectionLiterals.<EReference>newHashSet(_interProcessTrigger_Stimulus)));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.INTER_PROCESS_STIMULUS__COUNTER:
return basicSetCounter(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.INTER_PROCESS_STIMULUS__COUNTER:
return getCounter();
case AmaltheaPackage.INTER_PROCESS_STIMULUS__EXPLICIT_TRIGGERS:
return getExplicitTriggers();
}
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.INTER_PROCESS_STIMULUS__COUNTER:
setCounter((Counter)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.INTER_PROCESS_STIMULUS__COUNTER:
setCounter((Counter)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.INTER_PROCESS_STIMULUS__COUNTER:
return counter != null;
case AmaltheaPackage.INTER_PROCESS_STIMULUS__EXPLICIT_TRIGGERS:
return !getExplicitTriggers().isEmpty();
}
return super.eIsSet(featureID);
}
} //InterProcessStimulusImpl