| /** |
| * ******************************************************************************* |
| * 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.RunnableAllocation; |
| import org.eclipse.app4mc.amalthea.model.Scheduler; |
| |
| 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>Runnable Allocation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.RunnableAllocationImpl#getScheduler <em>Scheduler</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.RunnableAllocationImpl#getEntity <em>Entity</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class RunnableAllocationImpl extends BaseObjectImpl implements RunnableAllocation { |
| /** |
| * The cached value of the '{@link #getScheduler() <em>Scheduler</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getScheduler() |
| * @generated |
| * @ordered |
| */ |
| protected Scheduler scheduler; |
| |
| /** |
| * The cached value of the '{@link #getEntity() <em>Entity</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEntity() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.app4mc.amalthea.model.Runnable entity; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected RunnableAllocationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getRunnableAllocation(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Scheduler getScheduler() { |
| if (scheduler != null && scheduler.eIsProxy()) { |
| InternalEObject oldScheduler = (InternalEObject)scheduler; |
| scheduler = (Scheduler)eResolveProxy(oldScheduler); |
| if (scheduler != oldScheduler) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.RUNNABLE_ALLOCATION__SCHEDULER, oldScheduler, scheduler)); |
| } |
| } |
| return scheduler; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Scheduler basicGetScheduler() { |
| return scheduler; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setScheduler(Scheduler newScheduler) { |
| Scheduler oldScheduler = scheduler; |
| scheduler = newScheduler; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUNNABLE_ALLOCATION__SCHEDULER, oldScheduler, scheduler)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public org.eclipse.app4mc.amalthea.model.Runnable getEntity() { |
| if (entity != null && entity.eIsProxy()) { |
| InternalEObject oldEntity = (InternalEObject)entity; |
| entity = (org.eclipse.app4mc.amalthea.model.Runnable)eResolveProxy(oldEntity); |
| if (entity != oldEntity) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.RUNNABLE_ALLOCATION__ENTITY, oldEntity, entity)); |
| } |
| } |
| return entity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.app4mc.amalthea.model.Runnable basicGetEntity() { |
| return entity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setEntity(org.eclipse.app4mc.amalthea.model.Runnable newEntity) { |
| org.eclipse.app4mc.amalthea.model.Runnable oldEntity = entity; |
| entity = newEntity; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.RUNNABLE_ALLOCATION__ENTITY, oldEntity, entity)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.RUNNABLE_ALLOCATION__SCHEDULER: |
| if (resolve) return getScheduler(); |
| return basicGetScheduler(); |
| case AmaltheaPackage.RUNNABLE_ALLOCATION__ENTITY: |
| if (resolve) return getEntity(); |
| return basicGetEntity(); |
| } |
| 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.RUNNABLE_ALLOCATION__SCHEDULER: |
| setScheduler((Scheduler)newValue); |
| return; |
| case AmaltheaPackage.RUNNABLE_ALLOCATION__ENTITY: |
| setEntity((org.eclipse.app4mc.amalthea.model.Runnable)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.RUNNABLE_ALLOCATION__SCHEDULER: |
| setScheduler((Scheduler)null); |
| return; |
| case AmaltheaPackage.RUNNABLE_ALLOCATION__ENTITY: |
| setEntity((org.eclipse.app4mc.amalthea.model.Runnable)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.RUNNABLE_ALLOCATION__SCHEDULER: |
| return scheduler != null; |
| case AmaltheaPackage.RUNNABLE_ALLOCATION__ENTITY: |
| return entity != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //RunnableAllocationImpl |