/**
* <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.Condition;
import ssl.Given;
import ssl.SslPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Condition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link ssl.impl.ConditionImpl#getGiven <em>Given</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class ConditionImpl extends EObjectImpl implements Condition {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ConditionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SslPackage.Literals.CONDITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Given getGiven() {
if (eContainerFeatureID() != SslPackage.CONDITION__GIVEN) return null;
return (Given)eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetGiven(Given newGiven, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newGiven, SslPackage.CONDITION__GIVEN, msgs);
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setGiven(Given newGiven) {
if (newGiven != eInternalContainer() || (eContainerFeatureID() != SslPackage.CONDITION__GIVEN && newGiven != null)) {
if (EcoreUtil.isAncestor(this, newGiven))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newGiven != null)
msgs = ((InternalEObject)newGiven).eInverseAdd(this, SslPackage.GIVEN__CONDITIONS, Given.class, msgs);
msgs = basicSetGiven(newGiven, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SslPackage.CONDITION__GIVEN, newGiven, newGiven));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SslPackage.CONDITION__GIVEN:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetGiven((Given)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.CONDITION__GIVEN:
return basicSetGiven(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.CONDITION__GIVEN:
return eInternalContainer().eInverseRemove(this, SslPackage.GIVEN__CONDITIONS, Given.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.CONDITION__GIVEN:
return getGiven();
}
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.CONDITION__GIVEN:
setGiven((Given)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SslPackage.CONDITION__GIVEN:
setGiven((Given)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SslPackage.CONDITION__GIVEN:
return getGiven() != null;
}
return super.eIsSet(featureID);
}
} //ConditionImpl