/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.dresdenocl.language.ocl.impl;
import org.dresdenocl.language.ocl.DefinitionExpOperationCS;
import org.dresdenocl.language.ocl.OclExpressionCS;
import org.dresdenocl.language.ocl.OclPackage;
import org.dresdenocl.language.ocl.OperationDefinitionInDefCS;
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 Operation CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.dresdenocl.language.ocl.impl.DefinitionExpOperationCSImpl#getOperation <em>Operation</em>}</li>
* <li>{@link org.dresdenocl.language.ocl.impl.DefinitionExpOperationCSImpl#getEqual <em>Equal</em>}</li>
* <li>{@link org.dresdenocl.language.ocl.impl.DefinitionExpOperationCSImpl#getOclExpression <em>Ocl Expression</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class DefinitionExpOperationCSImpl extends DefinitionExpPartCSImpl implements DefinitionExpOperationCS {
/**
* The cached value of the '{@link #getOperation() <em>Operation</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOperation()
* @generated
* @ordered
*/
protected OperationDefinitionInDefCS operation;
/**
* The default value of the '{@link #getEqual() <em>Equal</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEqual()
* @generated
* @ordered
*/
protected static final String EQUAL_EDEFAULT = null;
/**
* The cached value of the '{@link #getEqual() <em>Equal</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEqual()
* @generated
* @ordered
*/
protected String equal = EQUAL_EDEFAULT;
/**
* The cached value of the '{@link #getOclExpression() <em>Ocl Expression</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOclExpression()
* @generated
* @ordered
*/
protected OclExpressionCS oclExpression;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DefinitionExpOperationCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return OclPackage.Literals.DEFINITION_EXP_OPERATION_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OperationDefinitionInDefCS getOperation() {
return operation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOperation(OperationDefinitionInDefCS newOperation, NotificationChain msgs) {
OperationDefinitionInDefCS oldOperation = operation;
operation = newOperation;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OclPackage.DEFINITION_EXP_OPERATION_CS__OPERATION, oldOperation, newOperation);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOperation(OperationDefinitionInDefCS newOperation) {
if (newOperation != operation) {
NotificationChain msgs = null;
if (operation != null)
msgs = ((InternalEObject)operation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OclPackage.DEFINITION_EXP_OPERATION_CS__OPERATION, null, msgs);
if (newOperation != null)
msgs = ((InternalEObject)newOperation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OclPackage.DEFINITION_EXP_OPERATION_CS__OPERATION, null, msgs);
msgs = basicSetOperation(newOperation, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OclPackage.DEFINITION_EXP_OPERATION_CS__OPERATION, newOperation, newOperation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getEqual() {
return equal;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEqual(String newEqual) {
String oldEqual = equal;
equal = newEqual;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OclPackage.DEFINITION_EXP_OPERATION_CS__EQUAL, oldEqual, equal));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OclExpressionCS getOclExpression() {
return oclExpression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOclExpression(OclExpressionCS newOclExpression, NotificationChain msgs) {
OclExpressionCS oldOclExpression = oclExpression;
oclExpression = newOclExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION, oldOclExpression, newOclExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOclExpression(OclExpressionCS newOclExpression) {
if (newOclExpression != oclExpression) {
NotificationChain msgs = null;
if (oclExpression != null)
msgs = ((InternalEObject)oclExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION, null, msgs);
if (newOclExpression != null)
msgs = ((InternalEObject)newOclExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION, null, msgs);
msgs = basicSetOclExpression(newOclExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION, newOclExpression, newOclExpression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case OclPackage.DEFINITION_EXP_OPERATION_CS__OPERATION:
return basicSetOperation(null, msgs);
case OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION:
return basicSetOclExpression(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_OPERATION_CS__OPERATION:
return getOperation();
case OclPackage.DEFINITION_EXP_OPERATION_CS__EQUAL:
return getEqual();
case OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION:
return getOclExpression();
}
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_OPERATION_CS__OPERATION:
setOperation((OperationDefinitionInDefCS)newValue);
return;
case OclPackage.DEFINITION_EXP_OPERATION_CS__EQUAL:
setEqual((String)newValue);
return;
case OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION:
setOclExpression((OclExpressionCS)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_OPERATION_CS__OPERATION:
setOperation((OperationDefinitionInDefCS)null);
return;
case OclPackage.DEFINITION_EXP_OPERATION_CS__EQUAL:
setEqual(EQUAL_EDEFAULT);
return;
case OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION:
setOclExpression((OclExpressionCS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case OclPackage.DEFINITION_EXP_OPERATION_CS__OPERATION:
return operation != null;
case OclPackage.DEFINITION_EXP_OPERATION_CS__EQUAL:
return EQUAL_EDEFAULT == null ? equal != null : !EQUAL_EDEFAULT.equals(equal);
case OclPackage.DEFINITION_EXP_OPERATION_CS__OCL_EXPRESSION:
return oclExpression != null;
}
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(" (equal: ");
result.append(equal);
result.append(')');
return result.toString();
}
} //DefinitionExpOperationCSImpl