| /** |
| * ******************************************************************************* |
| * 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.AccessPrecedenceSpec; |
| import org.eclipse.app4mc.amalthea.model.AccessPrecedenceType; |
| import org.eclipse.app4mc.amalthea.model.AmaltheaPackage; |
| import org.eclipse.app4mc.amalthea.model.Label; |
| |
| 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>Access Precedence Spec</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.AccessPrecedenceSpecImpl#getLabel <em>Label</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.AccessPrecedenceSpecImpl#getOrderType <em>Order Type</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AccessPrecedenceSpecImpl extends GeneralPrecedenceImpl implements AccessPrecedenceSpec { |
| /** |
| * 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 default value of the '{@link #getOrderType() <em>Order Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrderType() |
| * @generated |
| * @ordered |
| */ |
| protected static final AccessPrecedenceType ORDER_TYPE_EDEFAULT = AccessPrecedenceType._UNDEFINED_; |
| |
| /** |
| * The cached value of the '{@link #getOrderType() <em>Order Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrderType() |
| * @generated |
| * @ordered |
| */ |
| protected AccessPrecedenceType orderType = ORDER_TYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AccessPrecedenceSpecImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getAccessPrecedenceSpec(); |
| } |
| |
| /** |
| * <!-- 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.ACCESS_PRECEDENCE_SPEC__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.ACCESS_PRECEDENCE_SPEC__LABEL, oldLabel, label)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public AccessPrecedenceType getOrderType() { |
| return orderType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setOrderType(AccessPrecedenceType newOrderType) { |
| AccessPrecedenceType oldOrderType = orderType; |
| orderType = newOrderType == null ? ORDER_TYPE_EDEFAULT : newOrderType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__ORDER_TYPE, oldOrderType, orderType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__LABEL: |
| if (resolve) return getLabel(); |
| return basicGetLabel(); |
| case AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__ORDER_TYPE: |
| return getOrderType(); |
| } |
| 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.ACCESS_PRECEDENCE_SPEC__LABEL: |
| setLabel((Label)newValue); |
| return; |
| case AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__ORDER_TYPE: |
| setOrderType((AccessPrecedenceType)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__LABEL: |
| setLabel((Label)null); |
| return; |
| case AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__ORDER_TYPE: |
| setOrderType(ORDER_TYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__LABEL: |
| return label != null; |
| case AmaltheaPackage.ACCESS_PRECEDENCE_SPEC__ORDER_TYPE: |
| return orderType != ORDER_TYPE_EDEFAULT; |
| } |
| 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(" (orderType: "); |
| result.append(orderType); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //AccessPrecedenceSpecImpl |