| /** |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * 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.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.cubedsl.CubeMeasure; |
| |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartMeasure; |
| import org.eclipse.osbp.xtext.datamartdsl.ValueScaleEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Measure</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartMeasureImpl#isScaled <em>Scaled</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartMeasureImpl#getScale <em>Scale</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartMeasureImpl#getMeasureRef <em>Measure Ref</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartMeasureImpl extends ExpressionImpl implements DatamartMeasure { |
| /** |
| * The default value of the '{@link #isScaled() <em>Scaled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isScaled() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean SCALED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isScaled() <em>Scaled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isScaled() |
| * @generated |
| * @ordered |
| */ |
| protected boolean scaled = SCALED_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getScale() <em>Scale</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getScale() |
| * @generated |
| * @ordered |
| */ |
| protected static final ValueScaleEnum SCALE_EDEFAULT = ValueScaleEnum.AXIS; |
| |
| /** |
| * The cached value of the '{@link #getScale() <em>Scale</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getScale() |
| * @generated |
| * @ordered |
| */ |
| protected ValueScaleEnum scale = SCALE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getMeasureRef() <em>Measure Ref</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMeasureRef() |
| * @generated |
| * @ordered |
| */ |
| protected CubeMeasure measureRef; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartMeasureImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DatamartDSLPackage.Literals.DATAMART_MEASURE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isScaled() { |
| return scaled; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setScaled(boolean newScaled) { |
| boolean oldScaled = scaled; |
| scaled = newScaled; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_MEASURE__SCALED, oldScaled, scaled)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ValueScaleEnum getScale() { |
| return scale; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setScale(ValueScaleEnum newScale) { |
| ValueScaleEnum oldScale = scale; |
| scale = newScale == null ? SCALE_EDEFAULT : newScale; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_MEASURE__SCALE, oldScale, scale)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CubeMeasure getMeasureRef() { |
| if (measureRef != null && measureRef.eIsProxy()) { |
| InternalEObject oldMeasureRef = (InternalEObject)measureRef; |
| measureRef = (CubeMeasure)eResolveProxy(oldMeasureRef); |
| if (measureRef != oldMeasureRef) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DatamartDSLPackage.DATAMART_MEASURE__MEASURE_REF, oldMeasureRef, measureRef)); |
| } |
| } |
| return measureRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CubeMeasure basicGetMeasureRef() { |
| return measureRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMeasureRef(CubeMeasure newMeasureRef) { |
| CubeMeasure oldMeasureRef = measureRef; |
| measureRef = newMeasureRef; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_MEASURE__MEASURE_REF, oldMeasureRef, measureRef)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_MEASURE__SCALED: |
| return isScaled(); |
| case DatamartDSLPackage.DATAMART_MEASURE__SCALE: |
| return getScale(); |
| case DatamartDSLPackage.DATAMART_MEASURE__MEASURE_REF: |
| if (resolve) return getMeasureRef(); |
| return basicGetMeasureRef(); |
| } |
| 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_MEASURE__SCALED: |
| setScaled((Boolean)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_MEASURE__SCALE: |
| setScale((ValueScaleEnum)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_MEASURE__MEASURE_REF: |
| setMeasureRef((CubeMeasure)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_MEASURE__SCALED: |
| setScaled(SCALED_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_MEASURE__SCALE: |
| setScale(SCALE_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_MEASURE__MEASURE_REF: |
| setMeasureRef((CubeMeasure)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_MEASURE__SCALED: |
| return scaled != SCALED_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_MEASURE__SCALE: |
| return scale != SCALE_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_MEASURE__MEASURE_REF: |
| return measureRef != null; |
| } |
| 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(" (scaled: "); |
| result.append(scaled); |
| result.append(", scale: "); |
| result.append(scale); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DatamartMeasureImpl |