/**
*/
package at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.DecoraDslPackage;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.declaration_identifier_and_init;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.fully_specified_type;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.single_declaration;
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>single declaration</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl.single_declarationImpl#getT <em>T</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl.single_declarationImpl#getD <em>D</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class single_declarationImpl extends MinimalEObjectImpl.Container implements single_declaration
{
/**
* The cached value of the '{@link #getT() <em>T</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getT()
* @generated
* @ordered
*/
protected fully_specified_type t;
/**
* The cached value of the '{@link #getD() <em>D</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getD()
* @generated
* @ordered
*/
protected declaration_identifier_and_init d;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected single_declarationImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DecoraDslPackage.Literals.SINGLE_DECLARATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public fully_specified_type getT()
{
return t;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetT(fully_specified_type newT, NotificationChain msgs)
{
fully_specified_type oldT = t;
t = newT;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DecoraDslPackage.SINGLE_DECLARATION__T, oldT, newT);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setT(fully_specified_type newT)
{
if (newT != t)
{
NotificationChain msgs = null;
if (t != null)
msgs = ((InternalEObject)t).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.SINGLE_DECLARATION__T, null, msgs);
if (newT != null)
msgs = ((InternalEObject)newT).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.SINGLE_DECLARATION__T, null, msgs);
msgs = basicSetT(newT, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DecoraDslPackage.SINGLE_DECLARATION__T, newT, newT));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public declaration_identifier_and_init getD()
{
return d;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetD(declaration_identifier_and_init newD, NotificationChain msgs)
{
declaration_identifier_and_init oldD = d;
d = newD;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DecoraDslPackage.SINGLE_DECLARATION__D, oldD, newD);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setD(declaration_identifier_and_init newD)
{
if (newD != d)
{
NotificationChain msgs = null;
if (d != null)
msgs = ((InternalEObject)d).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.SINGLE_DECLARATION__D, null, msgs);
if (newD != null)
msgs = ((InternalEObject)newD).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.SINGLE_DECLARATION__D, null, msgs);
msgs = basicSetD(newD, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DecoraDslPackage.SINGLE_DECLARATION__D, newD, newD));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DecoraDslPackage.SINGLE_DECLARATION__T:
return basicSetT(null, msgs);
case DecoraDslPackage.SINGLE_DECLARATION__D:
return basicSetD(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.SINGLE_DECLARATION__T:
return getT();
case DecoraDslPackage.SINGLE_DECLARATION__D:
return getD();
}
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.SINGLE_DECLARATION__T:
setT((fully_specified_type)newValue);
return;
case DecoraDslPackage.SINGLE_DECLARATION__D:
setD((declaration_identifier_and_init)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DecoraDslPackage.SINGLE_DECLARATION__T:
setT((fully_specified_type)null);
return;
case DecoraDslPackage.SINGLE_DECLARATION__D:
setD((declaration_identifier_and_init)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DecoraDslPackage.SINGLE_DECLARATION__T:
return t != null;
case DecoraDslPackage.SINGLE_DECLARATION__D:
return d != null;
}
return super.eIsSet(featureID);
}
} //single_declarationImpl