/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.dresdenocl.language.ocl.impl;
import org.dresdenocl.language.ocl.DefinitionExpPropertyCS;
import org.dresdenocl.language.ocl.OclPackage;
import org.dresdenocl.language.ocl.VariableDeclarationWithInitCS;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Definition Exp Property CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.dresdenocl.language.ocl.impl.DefinitionExpPropertyCSImpl#getVariableDeclaration <em>Variable Declaration</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class DefinitionExpPropertyCSImpl extends DefinitionExpPartCSImpl implements DefinitionExpPropertyCS {
/**
* The cached value of the '{@link #getVariableDeclaration() <em>Variable Declaration</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVariableDeclaration()
* @generated
* @ordered
*/
protected VariableDeclarationWithInitCS variableDeclaration;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DefinitionExpPropertyCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return OclPackage.Literals.DEFINITION_EXP_PROPERTY_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public VariableDeclarationWithInitCS getVariableDeclaration() {
return variableDeclaration;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetVariableDeclaration(VariableDeclarationWithInitCS newVariableDeclaration, NotificationChain msgs) {
VariableDeclarationWithInitCS oldVariableDeclaration = variableDeclaration;
variableDeclaration = newVariableDeclaration;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION, oldVariableDeclaration, newVariableDeclaration);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVariableDeclaration(VariableDeclarationWithInitCS newVariableDeclaration) {
if (newVariableDeclaration != variableDeclaration) {
NotificationChain msgs = null;
if (variableDeclaration != null)
msgs = ((InternalEObject)variableDeclaration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION, null, msgs);
if (newVariableDeclaration != null)
msgs = ((InternalEObject)newVariableDeclaration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION, null, msgs);
msgs = basicSetVariableDeclaration(newVariableDeclaration, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION, newVariableDeclaration, newVariableDeclaration));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION:
return basicSetVariableDeclaration(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 OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION:
return getVariableDeclaration();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION:
setVariableDeclaration((VariableDeclarationWithInitCS)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION:
setVariableDeclaration((VariableDeclarationWithInitCS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case OclPackage.DEFINITION_EXP_PROPERTY_CS__VARIABLE_DECLARATION:
return variableDeclaration != null;
}
return super.eIsSet(featureID);
}
} //DefinitionExpPropertyCSImpl