blob: 05144aea7720ca265858926fabbd34196ffe139a [file] [log] [blame]
/**
* Copyright (c) 2016 Willink Transformations, Univesity of York 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
*
* Contributors:
* Adolfo Sanchez-Barbudo Herrera - initial API and implementation
*/
package delphi.impl;
import delphi.DelphiPackage;
import delphi.callStmnt;
import delphi.designator;
import delphi.exprList;
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>call Stmnt</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link delphi.impl.callStmntImpl#getDesignator <em>Designator</em>}</li>
* <li>{@link delphi.impl.callStmntImpl#getArgs <em>Args</em>}</li>
* </ul>
*
* @generated
*/
public class callStmntImpl extends simpleStatementImpl implements callStmnt {
/**
* The cached value of the '{@link #getDesignator() <em>Designator</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDesignator()
* @generated
* @ordered
*/
protected designator designator;
/**
* The cached value of the '{@link #getArgs() <em>Args</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArgs()
* @generated
* @ordered
*/
protected exprList args;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected callStmntImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DelphiPackage.Literals.CALL_STMNT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public designator getDesignator() {
return designator;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDesignator(designator newDesignator, NotificationChain msgs) {
designator oldDesignator = designator;
designator = newDesignator;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DelphiPackage.CALL_STMNT__DESIGNATOR, oldDesignator, newDesignator);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDesignator(designator newDesignator) {
if (newDesignator != designator) {
NotificationChain msgs = null;
if (designator != null)
msgs = ((InternalEObject)designator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DelphiPackage.CALL_STMNT__DESIGNATOR, null, msgs);
if (newDesignator != null)
msgs = ((InternalEObject)newDesignator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DelphiPackage.CALL_STMNT__DESIGNATOR, null, msgs);
msgs = basicSetDesignator(newDesignator, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DelphiPackage.CALL_STMNT__DESIGNATOR, newDesignator, newDesignator));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public exprList getArgs() {
return args;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetArgs(exprList newArgs, NotificationChain msgs) {
exprList oldArgs = args;
args = newArgs;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DelphiPackage.CALL_STMNT__ARGS, oldArgs, newArgs);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setArgs(exprList newArgs) {
if (newArgs != args) {
NotificationChain msgs = null;
if (args != null)
msgs = ((InternalEObject)args).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DelphiPackage.CALL_STMNT__ARGS, null, msgs);
if (newArgs != null)
msgs = ((InternalEObject)newArgs).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DelphiPackage.CALL_STMNT__ARGS, null, msgs);
msgs = basicSetArgs(newArgs, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DelphiPackage.CALL_STMNT__ARGS, newArgs, newArgs));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DelphiPackage.CALL_STMNT__DESIGNATOR:
return basicSetDesignator(null, msgs);
case DelphiPackage.CALL_STMNT__ARGS:
return basicSetArgs(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 DelphiPackage.CALL_STMNT__DESIGNATOR:
return getDesignator();
case DelphiPackage.CALL_STMNT__ARGS:
return getArgs();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DelphiPackage.CALL_STMNT__DESIGNATOR:
setDesignator((designator)newValue);
return;
case DelphiPackage.CALL_STMNT__ARGS:
setArgs((exprList)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DelphiPackage.CALL_STMNT__DESIGNATOR:
setDesignator((designator)null);
return;
case DelphiPackage.CALL_STMNT__ARGS:
setArgs((exprList)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DelphiPackage.CALL_STMNT__DESIGNATOR:
return designator != null;
case DelphiPackage.CALL_STMNT__ARGS:
return args != null;
}
return super.eIsSet(featureID);
}
} //callStmntImpl