/**
* <copyright>
* </copyright>
*
* $Id$
*/
package net.sf.etl.samples.ej.ast.impl;
import net.sf.etl.samples.ej.ast.AstPackage;
import net.sf.etl.samples.ej.ast.Expression;
import net.sf.etl.samples.ej.ast.Modifier;
import net.sf.etl.samples.ej.ast.Parameter;
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>Parameter</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link net.sf.etl.samples.ej.ast.impl.ParameterImpl#getFinalModifier <em>Final Modifier</em>}</li>
* <li>{@link net.sf.etl.samples.ej.ast.impl.ParameterImpl#getClassifier <em>Classifier</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ParameterImpl extends NamedElementImpl implements Parameter {
/**
* The cached value of the '{@link #getFinalModifier() <em>Final Modifier</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFinalModifier()
* @generated
* @ordered
*/
protected Modifier finalModifier = null;
/**
* The cached value of the '{@link #getClassifier() <em>Classifier</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClassifier()
* @generated
* @ordered
*/
protected Expression classifier = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ParameterImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return AstPackage.Literals.PARAMETER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Modifier getFinalModifier() {
return finalModifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFinalModifier(Modifier newFinalModifier, NotificationChain msgs) {
Modifier oldFinalModifier = finalModifier;
finalModifier = newFinalModifier;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.PARAMETER__FINAL_MODIFIER, oldFinalModifier, newFinalModifier);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFinalModifier(Modifier newFinalModifier) {
if (newFinalModifier != finalModifier) {
NotificationChain msgs = null;
if (finalModifier != null)
msgs = ((InternalEObject)finalModifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.PARAMETER__FINAL_MODIFIER, null, msgs);
if (newFinalModifier != null)
msgs = ((InternalEObject)newFinalModifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.PARAMETER__FINAL_MODIFIER, null, msgs);
msgs = basicSetFinalModifier(newFinalModifier, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.PARAMETER__FINAL_MODIFIER, newFinalModifier, newFinalModifier));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getClassifier() {
return classifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetClassifier(Expression newClassifier, NotificationChain msgs) {
Expression oldClassifier = classifier;
classifier = newClassifier;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.PARAMETER__CLASSIFIER, oldClassifier, newClassifier);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setClassifier(Expression newClassifier) {
if (newClassifier != classifier) {
NotificationChain msgs = null;
if (classifier != null)
msgs = ((InternalEObject)classifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.PARAMETER__CLASSIFIER, null, msgs);
if (newClassifier != null)
msgs = ((InternalEObject)newClassifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.PARAMETER__CLASSIFIER, null, msgs);
msgs = basicSetClassifier(newClassifier, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.PARAMETER__CLASSIFIER, newClassifier, newClassifier));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AstPackage.PARAMETER__FINAL_MODIFIER:
return basicSetFinalModifier(null, msgs);
case AstPackage.PARAMETER__CLASSIFIER:
return basicSetClassifier(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AstPackage.PARAMETER__FINAL_MODIFIER:
return getFinalModifier();
case AstPackage.PARAMETER__CLASSIFIER:
return getClassifier();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AstPackage.PARAMETER__FINAL_MODIFIER:
setFinalModifier((Modifier)newValue);
return;
case AstPackage.PARAMETER__CLASSIFIER:
setClassifier((Expression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case AstPackage.PARAMETER__FINAL_MODIFIER:
setFinalModifier((Modifier)null);
return;
case AstPackage.PARAMETER__CLASSIFIER:
setClassifier((Expression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case AstPackage.PARAMETER__FINAL_MODIFIER:
return finalModifier != null;
case AstPackage.PARAMETER__CLASSIFIER:
return classifier != null;
}
return super.eIsSet(featureID);
}
} //ParameterImpl