| /** |
| * ******************************************************************************* |
| * 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.ComponentPort; |
| import org.eclipse.app4mc.amalthea.model.Label; |
| import org.eclipse.app4mc.amalthea.model.SenderReceiverCommunication; |
| |
| 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>Sender Receiver Communication</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.SenderReceiverCommunicationImpl#isBuffered <em>Buffered</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.SenderReceiverCommunicationImpl#getLabel <em>Label</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.SenderReceiverCommunicationImpl#getPort <em>Port</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class SenderReceiverCommunicationImpl extends ActivityGraphItemImpl implements SenderReceiverCommunication { |
| /** |
| * The default value of the '{@link #isBuffered() <em>Buffered</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isBuffered() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean BUFFERED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isBuffered() <em>Buffered</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isBuffered() |
| * @generated |
| * @ordered |
| */ |
| protected boolean buffered = BUFFERED_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getLabel() <em>Label</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLabel() |
| * @generated |
| * @ordered |
| */ |
| protected Label label; |
| |
| /** |
| * The cached value of the '{@link #getPort() <em>Port</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPort() |
| * @generated |
| * @ordered |
| */ |
| protected ComponentPort port; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SenderReceiverCommunicationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getSenderReceiverCommunication(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isBuffered() { |
| return buffered; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setBuffered(boolean newBuffered) { |
| boolean oldBuffered = buffered; |
| buffered = newBuffered; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__BUFFERED, oldBuffered, buffered)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Label getLabel() { |
| if (label != null && label.eIsProxy()) { |
| InternalEObject oldLabel = (InternalEObject)label; |
| label = (Label)eResolveProxy(oldLabel); |
| if (label != oldLabel) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__LABEL, oldLabel, label)); |
| } |
| } |
| return label; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Label basicGetLabel() { |
| return label; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setLabel(Label newLabel) { |
| Label oldLabel = label; |
| label = newLabel; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__LABEL, oldLabel, label)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ComponentPort getPort() { |
| if (port != null && port.eIsProxy()) { |
| InternalEObject oldPort = (InternalEObject)port; |
| port = (ComponentPort)eResolveProxy(oldPort); |
| if (port != oldPort) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__PORT, oldPort, port)); |
| } |
| } |
| return port; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ComponentPort basicGetPort() { |
| return port; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setPort(ComponentPort newPort) { |
| ComponentPort oldPort = port; |
| port = newPort; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__PORT, oldPort, port)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__BUFFERED: |
| return isBuffered(); |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__LABEL: |
| if (resolve) return getLabel(); |
| return basicGetLabel(); |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__PORT: |
| if (resolve) return getPort(); |
| return basicGetPort(); |
| } |
| 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.SENDER_RECEIVER_COMMUNICATION__BUFFERED: |
| setBuffered((Boolean)newValue); |
| return; |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__LABEL: |
| setLabel((Label)newValue); |
| return; |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__PORT: |
| setPort((ComponentPort)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__BUFFERED: |
| setBuffered(BUFFERED_EDEFAULT); |
| return; |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__LABEL: |
| setLabel((Label)null); |
| return; |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__PORT: |
| setPort((ComponentPort)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__BUFFERED: |
| return buffered != BUFFERED_EDEFAULT; |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__LABEL: |
| return label != null; |
| case AmaltheaPackage.SENDER_RECEIVER_COMMUNICATION__PORT: |
| return port != 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(" (buffered: "); |
| result.append(buffered); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //SenderReceiverCommunicationImpl |