| /** |
| * ******************************************************************************* |
| * Copyright (c) 2017 Timing-Architects Embedded Systems 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 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Generated using Eclipse EMF |
| * |
| * ******************************************************************************* |
| */ |
| package org.eclipse.app4mc.amalthea.generator.configuration.impl; |
| |
| import org.eclipse.app4mc.amalthea.generator.configuration.IntegerTimeDistribution; |
| import org.eclipse.app4mc.amalthea.generator.configuration.RTMGCPackage; |
| import org.eclipse.app4mc.amalthea.generator.configuration.TimeUnit; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Integer Time Distribution</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.IntegerTimeDistributionImpl#getUnit <em>Unit</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class IntegerTimeDistributionImpl extends IntegerDistributionImpl implements IntegerTimeDistribution { |
| /** |
| * The default value of the '{@link #getUnit() <em>Unit</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUnit() |
| * @generated |
| * @ordered |
| */ |
| protected static final TimeUnit UNIT_EDEFAULT = TimeUnit.MS; |
| |
| /** |
| * The cached value of the '{@link #getUnit() <em>Unit</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUnit() |
| * @generated |
| * @ordered |
| */ |
| protected TimeUnit unit = UNIT_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected IntegerTimeDistributionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return RTMGCPackage.Literals.INTEGER_TIME_DISTRIBUTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public TimeUnit getUnit() { |
| return unit; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUnit(TimeUnit newUnit) { |
| TimeUnit oldUnit = unit; |
| unit = newUnit == null ? UNIT_EDEFAULT : newUnit; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.INTEGER_TIME_DISTRIBUTION__UNIT, oldUnit, unit)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case RTMGCPackage.INTEGER_TIME_DISTRIBUTION__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 RTMGCPackage.INTEGER_TIME_DISTRIBUTION__UNIT: |
| setUnit((TimeUnit)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case RTMGCPackage.INTEGER_TIME_DISTRIBUTION__UNIT: |
| setUnit(UNIT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case RTMGCPackage.INTEGER_TIME_DISTRIBUTION__UNIT: |
| return unit != UNIT_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(" (unit: "); |
| result.append(unit); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //IntegerTimeDistributionImpl |