/**
*/
package at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.DecoraDslPackage;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.compound_statement;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.simple_statement;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.statement;
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;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>statement</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl.statementImpl#getC <em>C</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl.statementImpl#getS <em>S</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class statementImpl extends MinimalEObjectImpl.Container implements statement
{
/**
* The cached value of the '{@link #getC() <em>C</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getC()
* @generated
* @ordered
*/
protected compound_statement c;
/**
* The cached value of the '{@link #getS() <em>S</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getS()
* @generated
* @ordered
*/
protected simple_statement s;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected statementImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DecoraDslPackage.Literals.STATEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public compound_statement getC()
{
return c;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetC(compound_statement newC, NotificationChain msgs)
{
compound_statement oldC = c;
c = newC;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DecoraDslPackage.STATEMENT__C, oldC, newC);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setC(compound_statement newC)
{
if (newC != c)
{
NotificationChain msgs = null;
if (c != null)
msgs = ((InternalEObject)c).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.STATEMENT__C, null, msgs);
if (newC != null)
msgs = ((InternalEObject)newC).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.STATEMENT__C, null, msgs);
msgs = basicSetC(newC, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DecoraDslPackage.STATEMENT__C, newC, newC));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public simple_statement getS()
{
return s;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetS(simple_statement newS, NotificationChain msgs)
{
simple_statement oldS = s;
s = newS;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DecoraDslPackage.STATEMENT__S, oldS, newS);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setS(simple_statement newS)
{
if (newS != s)
{
NotificationChain msgs = null;
if (s != null)
msgs = ((InternalEObject)s).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.STATEMENT__S, null, msgs);
if (newS != null)
msgs = ((InternalEObject)newS).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.STATEMENT__S, null, msgs);
msgs = basicSetS(newS, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DecoraDslPackage.STATEMENT__S, newS, newS));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DecoraDslPackage.STATEMENT__C:
return basicSetC(null, msgs);
case DecoraDslPackage.STATEMENT__S:
return basicSetS(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 DecoraDslPackage.STATEMENT__C:
return getC();
case DecoraDslPackage.STATEMENT__S:
return getS();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case DecoraDslPackage.STATEMENT__C:
setC((compound_statement)newValue);
return;
case DecoraDslPackage.STATEMENT__S:
setS((simple_statement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DecoraDslPackage.STATEMENT__C:
setC((compound_statement)null);
return;
case DecoraDslPackage.STATEMENT__S:
setS((simple_statement)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DecoraDslPackage.STATEMENT__C:
return c != null;
case DecoraDslPackage.STATEMENT__S:
return s != null;
}
return super.eIsSet(featureID);
}
} //statementImpl