blob: 18abd9d0877c65f013ce724c7d127d560861b8e0 [file] [log] [blame]
/**
* Copyright (c) 2018 CEA LIST.
*
* 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:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*/
package org.eclipse.efm.ecore.formalml.expression.impl;
import org.eclipse.efm.ecore.formalml.expression.ExpressionPackage;
import org.eclipse.efm.ecore.formalml.expression.LeftHandSideExpression;
import org.eclipse.efm.ecore.formalml.expression.NewfreshExpression;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Newfresh Expression</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.efm.ecore.formalml.expression.impl.NewfreshExpressionImpl#getLeftHandSide <em>Left Hand Side</em>}</li>
* </ul>
*
* @generated
*/
public class NewfreshExpressionImpl extends ExpressionImpl implements NewfreshExpression {
/**
* The cached value of the '{@link #getLeftHandSide() <em>Left Hand Side</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLeftHandSide()
* @generated
* @ordered
*/
protected LeftHandSideExpression leftHandSide;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected NewfreshExpressionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExpressionPackage.Literals.NEWFRESH_EXPRESSION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public LeftHandSideExpression getLeftHandSide() {
return leftHandSide;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLeftHandSide(LeftHandSideExpression newLeftHandSide, NotificationChain msgs) {
LeftHandSideExpression oldLeftHandSide = leftHandSide;
leftHandSide = newLeftHandSide;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE, oldLeftHandSide, newLeftHandSide);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setLeftHandSide(LeftHandSideExpression newLeftHandSide) {
if (newLeftHandSide != leftHandSide) {
NotificationChain msgs = null;
if (leftHandSide != null)
msgs = ((InternalEObject)leftHandSide).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE, null, msgs);
if (newLeftHandSide != null)
msgs = ((InternalEObject)newLeftHandSide).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE, null, msgs);
msgs = basicSetLeftHandSide(newLeftHandSide, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE, newLeftHandSide, newLeftHandSide));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE:
return basicSetLeftHandSide(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE:
return getLeftHandSide();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE:
setLeftHandSide((LeftHandSideExpression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE:
setLeftHandSide((LeftHandSideExpression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ExpressionPackage.NEWFRESH_EXPRESSION__LEFT_HAND_SIDE:
return leftHandSide != null;
}
return super.eIsSet(featureID);
}
} //NewfreshExpressionImpl