| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datamartdsl.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartFunction; |
| import org.eclipse.osbp.xtext.datamartdsl.FunctionEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Function</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartFunctionImpl#getFunction <em>Function</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartFunctionImpl extends MinimalEObjectImpl.Container implements DatamartFunction { |
| /** |
| * The default value of the '{@link #getFunction() <em>Function</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFunction() |
| * @generated |
| * @ordered |
| */ |
| protected static final FunctionEnum FUNCTION_EDEFAULT = FunctionEnum.PREVMEMBER; |
| |
| /** |
| * The cached value of the '{@link #getFunction() <em>Function</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFunction() |
| * @generated |
| * @ordered |
| */ |
| protected FunctionEnum function = FUNCTION_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartFunctionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DatamartDSLPackage.Literals.DATAMART_FUNCTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionEnum getFunction() { |
| return function; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFunction(FunctionEnum newFunction) { |
| FunctionEnum oldFunction = function; |
| function = newFunction == null ? FUNCTION_EDEFAULT : newFunction; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_FUNCTION__FUNCTION, oldFunction, function)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_FUNCTION__FUNCTION: |
| return getFunction(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_FUNCTION__FUNCTION: |
| setFunction((FunctionEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_FUNCTION__FUNCTION: |
| setFunction(FUNCTION_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_FUNCTION__FUNCTION: |
| return function != FUNCTION_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(" (function: "); |
| result.append(function); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DatamartFunctionImpl |