| /******************************************************************************* |
| * Copyright (c) 2014 Bosch Software Innovations GmbH and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * and Eclipse Distribution License v1.0 which accompany this distribution. |
| * |
| * The Eclipse Public License is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * The Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Contributors: |
| * Bosch Software Innovations GmbH - Please refer to git log |
| * |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.vorto.functionblock.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.vorto.functionblock.FunctionblockPackage; |
| import org.eclipse.vorto.functionblock.PrimitiveParam; |
| import org.eclipse.vorto.functionblock.PrimitiveType; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Primitive Param</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.vorto.functionblock.impl.PrimitiveParamImpl#getParamType <em>Param Type</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PrimitiveParamImpl extends ParameterImpl implements PrimitiveParam { |
| /** |
| * The default value of the '{@link #getParamType() <em>Param Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getParamType() |
| * @generated |
| * @ordered |
| */ |
| protected static final PrimitiveType PARAM_TYPE_EDEFAULT = PrimitiveType.STRING; |
| |
| /** |
| * The cached value of the '{@link #getParamType() <em>Param Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getParamType() |
| * @generated |
| * @ordered |
| */ |
| protected PrimitiveType paramType = PARAM_TYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PrimitiveParamImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FunctionblockPackage.Literals.PRIMITIVE_PARAM; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PrimitiveType getParamType() { |
| return paramType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setParamType(PrimitiveType newParamType) { |
| PrimitiveType oldParamType = paramType; |
| paramType = newParamType == null ? PARAM_TYPE_EDEFAULT : newParamType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FunctionblockPackage.PRIMITIVE_PARAM__PARAM_TYPE, oldParamType, paramType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FunctionblockPackage.PRIMITIVE_PARAM__PARAM_TYPE: |
| return getParamType(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FunctionblockPackage.PRIMITIVE_PARAM__PARAM_TYPE: |
| setParamType((PrimitiveType)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FunctionblockPackage.PRIMITIVE_PARAM__PARAM_TYPE: |
| setParamType(PARAM_TYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FunctionblockPackage.PRIMITIVE_PARAM__PARAM_TYPE: |
| return paramType != PARAM_TYPE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (paramType: "); |
| result.append(paramType); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PrimitiveParamImpl |