/**
* <copyright>
* </copyright>
*
* $Id$
*/
package ssl.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.EObjectImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import ssl.Action;
import ssl.SslPackage;
import ssl.When;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Action</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link ssl.impl.ActionImpl#getWhen <em>When</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class ActionImpl extends EObjectImpl implements Action {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ActionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SslPackage.Literals.ACTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public When getWhen() {
if (eContainerFeatureID() != SslPackage.ACTION__WHEN) return null;
return (When)eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetWhen(When newWhen, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newWhen, SslPackage.ACTION__WHEN, msgs);
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setWhen(When newWhen) {
if (newWhen != eInternalContainer() || (eContainerFeatureID() != SslPackage.ACTION__WHEN && newWhen != null)) {
if (EcoreUtil.isAncestor(this, newWhen))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newWhen != null)
msgs = ((InternalEObject)newWhen).eInverseAdd(this, SslPackage.WHEN__ACTIONS, When.class, msgs);
msgs = basicSetWhen(newWhen, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SslPackage.ACTION__WHEN, newWhen, newWhen));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SslPackage.ACTION__WHEN:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetWhen((When)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SslPackage.ACTION__WHEN:
return basicSetWhen(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case SslPackage.ACTION__WHEN:
return eInternalContainer().eInverseRemove(this, SslPackage.WHEN__ACTIONS, When.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SslPackage.ACTION__WHEN:
return getWhen();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SslPackage.ACTION__WHEN:
setWhen((When)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SslPackage.ACTION__WHEN:
setWhen((When)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SslPackage.ACTION__WHEN:
return getWhen() != null;
}
return super.eIsSet(featureID);
}
} //ActionImpl