| /** |
| * ******************************************************************************* |
| * 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.ProcessChain; |
| import org.eclipse.app4mc.amalthea.model.ProcessChainEvent; |
| import org.eclipse.app4mc.amalthea.model.ProcessEventType; |
| import org.eclipse.app4mc.amalthea.model.ProcessingUnit; |
| |
| 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>Process Chain Event</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.ProcessChainEventImpl#getEventType <em>Event Type</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.ProcessChainEventImpl#getEntity <em>Entity</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.ProcessChainEventImpl#getProcessingUnit <em>Processing Unit</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ProcessChainEventImpl extends EntityEventImpl implements ProcessChainEvent { |
| /** |
| * The default value of the '{@link #getEventType() <em>Event Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEventType() |
| * @generated |
| * @ordered |
| */ |
| protected static final ProcessEventType EVENT_TYPE_EDEFAULT = ProcessEventType._ALL_; |
| |
| /** |
| * The cached value of the '{@link #getEventType() <em>Event Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEventType() |
| * @generated |
| * @ordered |
| */ |
| protected ProcessEventType eventType = EVENT_TYPE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getEntity() <em>Entity</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEntity() |
| * @generated |
| * @ordered |
| */ |
| protected ProcessChain entity; |
| |
| /** |
| * The cached value of the '{@link #getProcessingUnit() <em>Processing Unit</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProcessingUnit() |
| * @generated |
| * @ordered |
| */ |
| protected ProcessingUnit processingUnit; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ProcessChainEventImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getProcessChainEvent(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ProcessEventType getEventType() { |
| return eventType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setEventType(ProcessEventType newEventType) { |
| ProcessEventType oldEventType = eventType; |
| eventType = newEventType == null ? EVENT_TYPE_EDEFAULT : newEventType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PROCESS_CHAIN_EVENT__EVENT_TYPE, oldEventType, eventType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ProcessChain getEntity() { |
| if (entity != null && entity.eIsProxy()) { |
| InternalEObject oldEntity = (InternalEObject)entity; |
| entity = (ProcessChain)eResolveProxy(oldEntity); |
| if (entity != oldEntity) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.PROCESS_CHAIN_EVENT__ENTITY, oldEntity, entity)); |
| } |
| } |
| return entity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ProcessChain basicGetEntity() { |
| return entity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setEntity(ProcessChain newEntity) { |
| ProcessChain oldEntity = entity; |
| entity = newEntity; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PROCESS_CHAIN_EVENT__ENTITY, oldEntity, entity)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ProcessingUnit getProcessingUnit() { |
| if (processingUnit != null && processingUnit.eIsProxy()) { |
| InternalEObject oldProcessingUnit = (InternalEObject)processingUnit; |
| processingUnit = (ProcessingUnit)eResolveProxy(oldProcessingUnit); |
| if (processingUnit != oldProcessingUnit) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.PROCESS_CHAIN_EVENT__PROCESSING_UNIT, oldProcessingUnit, processingUnit)); |
| } |
| } |
| return processingUnit; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ProcessingUnit basicGetProcessingUnit() { |
| return processingUnit; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setProcessingUnit(ProcessingUnit newProcessingUnit) { |
| ProcessingUnit oldProcessingUnit = processingUnit; |
| processingUnit = newProcessingUnit; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PROCESS_CHAIN_EVENT__PROCESSING_UNIT, oldProcessingUnit, processingUnit)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__EVENT_TYPE: |
| return getEventType(); |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__ENTITY: |
| if (resolve) return getEntity(); |
| return basicGetEntity(); |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__PROCESSING_UNIT: |
| if (resolve) return getProcessingUnit(); |
| return basicGetProcessingUnit(); |
| } |
| 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.PROCESS_CHAIN_EVENT__EVENT_TYPE: |
| setEventType((ProcessEventType)newValue); |
| return; |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__ENTITY: |
| setEntity((ProcessChain)newValue); |
| return; |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__PROCESSING_UNIT: |
| setProcessingUnit((ProcessingUnit)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__EVENT_TYPE: |
| setEventType(EVENT_TYPE_EDEFAULT); |
| return; |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__ENTITY: |
| setEntity((ProcessChain)null); |
| return; |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__PROCESSING_UNIT: |
| setProcessingUnit((ProcessingUnit)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__EVENT_TYPE: |
| return eventType != EVENT_TYPE_EDEFAULT; |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__ENTITY: |
| return entity != null; |
| case AmaltheaPackage.PROCESS_CHAIN_EVENT__PROCESSING_UNIT: |
| return processingUnit != null; |
| } |
| 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(" (eventType: "); |
| result.append(eventType); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ProcessChainEventImpl |