| /** |
| * Copyright (c) 2018 CEA |
| * |
| * 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 |
| * |
| * Contributors: |
| * Jérémie Tatibouet (CEA) jeremie.tatibouet@cea.fr - Initial API and implementation |
| * Benoit Maggi (CEA) benoit.maggi@cea.fr - Initial API and implementation |
| * Shuai Li (CEA) shuai.li@cea.fr - Integration of sensiNact and Web of Things Thing Description |
| * |
| */ |
| package org.eclipse.papyrus.iotml.sensinact.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.papyrus.iotml.sensinact.Action; |
| import org.eclipse.papyrus.iotml.sensinact.SensinactPackage; |
| import org.eclipse.papyrus.iotml.sensinact.StateVariable; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>State Variable</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.iotml.sensinact.impl.StateVariableImpl#getModifier <em>Modifier</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class StateVariableImpl extends ResourceImpl implements StateVariable { |
| /** |
| * The cached value of the '{@link #getModifier() <em>Modifier</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getModifier() |
| * @generated |
| * @ordered |
| */ |
| protected Action modifier; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected StateVariableImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return SensinactPackage.Literals.STATE_VARIABLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Action getModifier() { |
| if (modifier != null && modifier.eIsProxy()) { |
| InternalEObject oldModifier = (InternalEObject)modifier; |
| modifier = (Action)eResolveProxy(oldModifier); |
| if (modifier != oldModifier) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, SensinactPackage.STATE_VARIABLE__MODIFIER, oldModifier, modifier)); |
| } |
| } |
| return modifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Action basicGetModifier() { |
| return modifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setModifier(Action newModifier) { |
| Action oldModifier = modifier; |
| modifier = newModifier; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SensinactPackage.STATE_VARIABLE__MODIFIER, oldModifier, modifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case SensinactPackage.STATE_VARIABLE__MODIFIER: |
| if (resolve) return getModifier(); |
| return basicGetModifier(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case SensinactPackage.STATE_VARIABLE__MODIFIER: |
| setModifier((Action)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case SensinactPackage.STATE_VARIABLE__MODIFIER: |
| setModifier((Action)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case SensinactPackage.STATE_VARIABLE__MODIFIER: |
| return modifier != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //StateVariableImpl |