blob: cb3389e249b37ee32581661fd998b9548141437f [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.ISR;
import org.eclipse.app4mc.amalthea.model.ISRAllocation;
import org.eclipse.app4mc.amalthea.model.InterruptController;
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>ISR Allocation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ISRAllocationImpl#getIsr <em>Isr</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ISRAllocationImpl#getController <em>Controller</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ISRAllocationImpl#getPriority <em>Priority</em>}</li>
* </ul>
*
* @generated
*/
public class ISRAllocationImpl extends BaseObjectImpl implements ISRAllocation {
/**
* The cached value of the '{@link #getIsr() <em>Isr</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIsr()
* @generated
* @ordered
*/
protected ISR isr;
/**
* The cached value of the '{@link #getController() <em>Controller</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getController()
* @generated
* @ordered
*/
protected InterruptController controller;
/**
* The default value of the '{@link #getPriority() <em>Priority</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPriority()
* @generated
* @ordered
*/
protected static final Integer PRIORITY_EDEFAULT = null;
/**
* The cached value of the '{@link #getPriority() <em>Priority</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPriority()
* @generated
* @ordered
*/
protected Integer priority = PRIORITY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ISRAllocationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getISRAllocation();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ISR getIsr() {
if (isr != null && isr.eIsProxy()) {
InternalEObject oldIsr = (InternalEObject)isr;
isr = (ISR)eResolveProxy(oldIsr);
if (isr != oldIsr) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.ISR_ALLOCATION__ISR, oldIsr, isr));
}
}
return isr;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ISR basicGetIsr() {
return isr;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setIsr(ISR newIsr) {
ISR oldIsr = isr;
isr = newIsr;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ISR_ALLOCATION__ISR, oldIsr, isr));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public InterruptController getController() {
if (controller != null && controller.eIsProxy()) {
InternalEObject oldController = (InternalEObject)controller;
controller = (InterruptController)eResolveProxy(oldController);
if (controller != oldController) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.ISR_ALLOCATION__CONTROLLER, oldController, controller));
}
}
return controller;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InterruptController basicGetController() {
return controller;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setController(InterruptController newController) {
InterruptController oldController = controller;
controller = newController;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ISR_ALLOCATION__CONTROLLER, oldController, controller));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Integer getPriority() {
return priority;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setPriority(Integer newPriority) {
Integer oldPriority = priority;
priority = newPriority;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ISR_ALLOCATION__PRIORITY, oldPriority, priority));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.ISR_ALLOCATION__ISR:
if (resolve) return getIsr();
return basicGetIsr();
case AmaltheaPackage.ISR_ALLOCATION__CONTROLLER:
if (resolve) return getController();
return basicGetController();
case AmaltheaPackage.ISR_ALLOCATION__PRIORITY:
return getPriority();
}
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.ISR_ALLOCATION__ISR:
setIsr((ISR)newValue);
return;
case AmaltheaPackage.ISR_ALLOCATION__CONTROLLER:
setController((InterruptController)newValue);
return;
case AmaltheaPackage.ISR_ALLOCATION__PRIORITY:
setPriority((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.ISR_ALLOCATION__ISR:
setIsr((ISR)null);
return;
case AmaltheaPackage.ISR_ALLOCATION__CONTROLLER:
setController((InterruptController)null);
return;
case AmaltheaPackage.ISR_ALLOCATION__PRIORITY:
setPriority(PRIORITY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.ISR_ALLOCATION__ISR:
return isr != null;
case AmaltheaPackage.ISR_ALLOCATION__CONTROLLER:
return controller != null;
case AmaltheaPackage.ISR_ALLOCATION__PRIORITY:
return PRIORITY_EDEFAULT == null ? priority != null : !PRIORITY_EDEFAULT.equals(priority);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (priority: ");
result.append(priority);
result.append(')');
return result.toString();
}
} //ISRAllocationImpl