blob: c622a5333132c98c860a217a1ab7e383343073b6 [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.Counter;
import org.eclipse.app4mc.amalthea.model.EventMask;
import org.eclipse.app4mc.amalthea.model.SetEvent;
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>Set Event</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.SetEventImpl#getEventMask <em>Event Mask</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.SetEventImpl#getProcess <em>Process</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.SetEventImpl#getCounter <em>Counter</em>}</li>
* </ul>
*
* @generated
*/
public class SetEventImpl extends ActivityGraphItemImpl implements SetEvent {
/**
* The cached value of the '{@link #getEventMask() <em>Event Mask</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEventMask()
* @generated
* @ordered
*/
protected EventMask eventMask;
/**
* The cached value of the '{@link #getProcess() <em>Process</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProcess()
* @generated
* @ordered
*/
protected org.eclipse.app4mc.amalthea.model.Process process;
/**
* 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 SetEventImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getSetEvent();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EventMask getEventMask() {
return eventMask;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetEventMask(EventMask newEventMask, NotificationChain msgs) {
EventMask oldEventMask = eventMask;
eventMask = newEventMask;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.SET_EVENT__EVENT_MASK, oldEventMask, newEventMask);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setEventMask(EventMask newEventMask) {
if (newEventMask != eventMask) {
NotificationChain msgs = null;
if (eventMask != null)
msgs = ((InternalEObject)eventMask).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.SET_EVENT__EVENT_MASK, null, msgs);
if (newEventMask != null)
msgs = ((InternalEObject)newEventMask).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.SET_EVENT__EVENT_MASK, null, msgs);
msgs = basicSetEventMask(newEventMask, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.SET_EVENT__EVENT_MASK, newEventMask, newEventMask));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public org.eclipse.app4mc.amalthea.model.Process getProcess() {
if (process != null && process.eIsProxy()) {
InternalEObject oldProcess = (InternalEObject)process;
process = (org.eclipse.app4mc.amalthea.model.Process)eResolveProxy(oldProcess);
if (process != oldProcess) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.SET_EVENT__PROCESS, oldProcess, process));
}
}
return process;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.app4mc.amalthea.model.Process basicGetProcess() {
return process;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setProcess(org.eclipse.app4mc.amalthea.model.Process newProcess) {
org.eclipse.app4mc.amalthea.model.Process oldProcess = process;
process = newProcess;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.SET_EVENT__PROCESS, oldProcess, process));
}
/**
* <!-- 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.SET_EVENT__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.SET_EVENT__COUNTER, null, msgs);
if (newCounter != null)
msgs = ((InternalEObject)newCounter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.SET_EVENT__COUNTER, null, msgs);
msgs = basicSetCounter(newCounter, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.SET_EVENT__COUNTER, newCounter, newCounter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.SET_EVENT__EVENT_MASK:
return basicSetEventMask(null, msgs);
case AmaltheaPackage.SET_EVENT__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.SET_EVENT__EVENT_MASK:
return getEventMask();
case AmaltheaPackage.SET_EVENT__PROCESS:
if (resolve) return getProcess();
return basicGetProcess();
case AmaltheaPackage.SET_EVENT__COUNTER:
return getCounter();
}
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.SET_EVENT__EVENT_MASK:
setEventMask((EventMask)newValue);
return;
case AmaltheaPackage.SET_EVENT__PROCESS:
setProcess((org.eclipse.app4mc.amalthea.model.Process)newValue);
return;
case AmaltheaPackage.SET_EVENT__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.SET_EVENT__EVENT_MASK:
setEventMask((EventMask)null);
return;
case AmaltheaPackage.SET_EVENT__PROCESS:
setProcess((org.eclipse.app4mc.amalthea.model.Process)null);
return;
case AmaltheaPackage.SET_EVENT__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.SET_EVENT__EVENT_MASK:
return eventMask != null;
case AmaltheaPackage.SET_EVENT__PROCESS:
return process != null;
case AmaltheaPackage.SET_EVENT__COUNTER:
return counter != null;
}
return super.eIsSet(featureID);
}
} //SetEventImpl