| /** |
| * Copyright (c) 2016 CEA LIST. |
| * |
| * 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 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.moka.fmi.modeldescription.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.papyrus.moka.fmi.modeldescription.BooleanType; |
| import org.eclipse.papyrus.moka.fmi.modeldescription.FmiPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Boolean Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.moka.fmi.modeldescription.impl.BooleanTypeImpl#getDeclaredType <em>Declared Type</em>}</li> |
| * <li>{@link org.eclipse.papyrus.moka.fmi.modeldescription.impl.BooleanTypeImpl#isStart <em>Start</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BooleanTypeImpl extends MinimalEObjectImpl.Container implements BooleanType { |
| /** |
| * The default value of the '{@link #getDeclaredType() <em>Declared Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDeclaredType() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DECLARED_TYPE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDeclaredType() <em>Declared Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDeclaredType() |
| * @generated |
| * @ordered |
| */ |
| protected String declaredType = DECLARED_TYPE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isStart() <em>Start</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isStart() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean START_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isStart() <em>Start</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isStart() |
| * @generated |
| * @ordered |
| */ |
| protected boolean start = START_EDEFAULT; |
| |
| /** |
| * This is true if the Start attribute has been set. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| protected boolean startESet; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BooleanTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FmiPackage.Literals.BOOLEAN_TYPE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getDeclaredType() { |
| return declaredType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setDeclaredType(String newDeclaredType) { |
| String oldDeclaredType = declaredType; |
| declaredType = newDeclaredType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FmiPackage.BOOLEAN_TYPE__DECLARED_TYPE, oldDeclaredType, declaredType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isStart() { |
| return start; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setStart(boolean newStart) { |
| boolean oldStart = start; |
| start = newStart; |
| boolean oldStartESet = startESet; |
| startESet = true; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FmiPackage.BOOLEAN_TYPE__START, oldStart, start, !oldStartESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void unsetStart() { |
| boolean oldStart = start; |
| boolean oldStartESet = startESet; |
| start = START_EDEFAULT; |
| startESet = false; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.UNSET, FmiPackage.BOOLEAN_TYPE__START, oldStart, START_EDEFAULT, oldStartESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isSetStart() { |
| return startESet; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FmiPackage.BOOLEAN_TYPE__DECLARED_TYPE: |
| return getDeclaredType(); |
| case FmiPackage.BOOLEAN_TYPE__START: |
| return isStart(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FmiPackage.BOOLEAN_TYPE__DECLARED_TYPE: |
| setDeclaredType((String)newValue); |
| return; |
| case FmiPackage.BOOLEAN_TYPE__START: |
| setStart((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FmiPackage.BOOLEAN_TYPE__DECLARED_TYPE: |
| setDeclaredType(DECLARED_TYPE_EDEFAULT); |
| return; |
| case FmiPackage.BOOLEAN_TYPE__START: |
| unsetStart(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FmiPackage.BOOLEAN_TYPE__DECLARED_TYPE: |
| return DECLARED_TYPE_EDEFAULT == null ? declaredType != null : !DECLARED_TYPE_EDEFAULT.equals(declaredType); |
| case FmiPackage.BOOLEAN_TYPE__START: |
| return isSetStart(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (declaredType: "); |
| result.append(declaredType); |
| result.append(", start: "); |
| if (startESet) result.append(start); else result.append("<unset>"); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //BooleanTypeImpl |