| /**
|
| * *******************************************************************************
|
| * Copyright (c) 2008, 2019 Castor Technologies Inc and others.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| * Alain Picard (Castor Technologies Inc) - initial API and implementation
|
| * *******************************************************************************
|
| *
|
| * $Id$
|
| */ |
| package org.eclipse.gmt.modisco.omg.smm.impl;
|
|
|
| import org.eclipse.emf.common.notify.Notification;
|
|
|
| import org.eclipse.emf.ecore.EClass;
|
|
|
| import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
|
|
| import org.eclipse.gmt.modisco.omg.smm.DimensionalMeasure;
|
| import org.eclipse.gmt.modisco.omg.smm.SmmPackage;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>Dimensional Measure</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.gmt.modisco.omg.smm.impl.DimensionalMeasureImpl#getUnit <em>Unit</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| */
|
| public class DimensionalMeasureImpl extends MeasureImpl implements DimensionalMeasure {
|
| /**
|
| * The default value of the '{@link #getUnit() <em>Unit</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getUnit()
|
| * @generated
|
| * @ordered
|
| */
|
| protected static final String UNIT_EDEFAULT = null;
|
|
|
| /**
|
| * The cached value of the '{@link #getUnit() <em>Unit</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getUnit()
|
| * @generated
|
| * @ordered
|
| */
|
| protected String unit = UNIT_EDEFAULT;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected DimensionalMeasureImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return SmmPackage.Literals.DIMENSIONAL_MEASURE;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public String getUnit() {
|
| return unit;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setUnit(String newUnit) {
|
| String oldUnit = unit;
|
| unit = newUnit;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, SmmPackage.DIMENSIONAL_MEASURE__UNIT, oldUnit, unit));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
| switch (featureID) {
|
| case SmmPackage.DIMENSIONAL_MEASURE__UNIT:
|
| return getUnit();
|
| }
|
| return super.eGet(featureID, resolve, coreType);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eSet(int featureID, Object newValue) {
|
| switch (featureID) {
|
| case SmmPackage.DIMENSIONAL_MEASURE__UNIT:
|
| setUnit((String)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case SmmPackage.DIMENSIONAL_MEASURE__UNIT:
|
| setUnit(UNIT_EDEFAULT);
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case SmmPackage.DIMENSIONAL_MEASURE__UNIT:
|
| return UNIT_EDEFAULT == null ? unit != null : !UNIT_EDEFAULT.equals(unit);
|
| }
|
| 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(" (unit: "); //$NON-NLS-1$
|
| result.append(unit);
|
| result.append(')');
|
| return result.toString();
|
| }
|
|
|
| } //DimensionalMeasureImpl
|