/**
*/
package at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.DecoraDslPackage;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.parameter_declaration;
import at.bestsolution.efxclipse.tooling.decora.decoraDsl.type_specifier;
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>parameter declaration</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl.parameter_declarationImpl#getT <em>T</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.decora.decoraDsl.impl.parameter_declarationImpl#getId <em>Id</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class parameter_declarationImpl extends MinimalEObjectImpl.Container implements parameter_declaration
{
/**
* The cached value of the '{@link #getT() <em>T</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getT()
* @generated
* @ordered
*/
protected type_specifier t;
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected parameter_declarationImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DecoraDslPackage.Literals.PARAMETER_DECLARATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public type_specifier getT()
{
return t;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetT(type_specifier newT, NotificationChain msgs)
{
type_specifier oldT = t;
t = newT;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DecoraDslPackage.PARAMETER_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(type_specifier newT)
{
if (newT != t)
{
NotificationChain msgs = null;
if (t != null)
msgs = ((InternalEObject)t).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.PARAMETER_DECLARATION__T, null, msgs);
if (newT != null)
msgs = ((InternalEObject)newT).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DecoraDslPackage.PARAMETER_DECLARATION__T, null, msgs);
msgs = basicSetT(newT, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DecoraDslPackage.PARAMETER_DECLARATION__T, newT, newT));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId()
{
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId)
{
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DecoraDslPackage.PARAMETER_DECLARATION__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DecoraDslPackage.PARAMETER_DECLARATION__T:
return basicSetT(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.PARAMETER_DECLARATION__T:
return getT();
case DecoraDslPackage.PARAMETER_DECLARATION__ID:
return getId();
}
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.PARAMETER_DECLARATION__T:
setT((type_specifier)newValue);
return;
case DecoraDslPackage.PARAMETER_DECLARATION__ID:
setId((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DecoraDslPackage.PARAMETER_DECLARATION__T:
setT((type_specifier)null);
return;
case DecoraDslPackage.PARAMETER_DECLARATION__ID:
setId(ID_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DecoraDslPackage.PARAMETER_DECLARATION__T:
return t != null;
case DecoraDslPackage.PARAMETER_DECLARATION__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (id: ");
result.append(id);
result.append(')');
return result.toString();
}
} //parameter_declarationImpl