org.openxma.dsl.ddl.ddlDsl.impl.AlterTableActionImpl Maven / Gradle / Ivy
/**
*
*
*
*/
package org.openxma.dsl.ddl.ddlDsl.impl;
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;
import org.openxma.dsl.ddl.ddlDsl.AlterTableAction;
import org.openxma.dsl.ddl.ddlDsl.Constraint;
import org.openxma.dsl.ddl.ddlDsl.DdlDslPackage;
/**
*
* An implementation of the model object 'Alter Table Action'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.AlterTableActionImpl#getConstraint Constraint}
*
*
*
* @generated
*/
public class AlterTableActionImpl extends MinimalEObjectImpl.Container implements AlterTableAction
{
/**
* The cached value of the '{@link #getConstraint() Constraint}' containment reference.
*
*
* @see #getConstraint()
* @generated
* @ordered
*/
protected Constraint constraint;
/**
*
*
* @generated
*/
protected AlterTableActionImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DdlDslPackage.Literals.ALTER_TABLE_ACTION;
}
/**
*
*
* @generated
*/
public Constraint getConstraint()
{
return constraint;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetConstraint(Constraint newConstraint, NotificationChain msgs)
{
Constraint oldConstraint = constraint;
constraint = newConstraint;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT, oldConstraint, newConstraint);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setConstraint(Constraint newConstraint)
{
if (newConstraint != constraint) {
NotificationChain msgs = null;
if (constraint != null)
msgs = ((InternalEObject)constraint).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT, null, msgs);
if (newConstraint != null)
msgs = ((InternalEObject)newConstraint).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT, null, msgs);
msgs = basicSetConstraint(newConstraint, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT, newConstraint, newConstraint));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID) {
case DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT:
return basicSetConstraint(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID) {
case DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT:
return getConstraint();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID) {
case DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT:
setConstraint((Constraint)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID) {
case DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT:
setConstraint((Constraint)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID) {
case DdlDslPackage.ALTER_TABLE_ACTION__CONSTRAINT:
return constraint != null;
}
return super.eIsSet(featureID);
}
} //AlterTableActionImpl