/**
*/
package org.eclipse.viatra.solver.language.solverLanguage.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.viatra.solver.language.solverLanguage.FunctionDefinition;
import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage;
import org.eclipse.viatra.solver.language.solverLanguage.Symbol;
/**
*
* An implementation of the model object 'Function Definition'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.FunctionDefinitionImpl#getResultType Result Type}
*
*
* @generated
*/
public class FunctionDefinitionImpl extends FunctorDefinitonImpl implements FunctionDefinition {
/**
* The cached value of the '{@link #getResultType() Result Type}' reference.
*
*
* @see #getResultType()
* @generated
* @ordered
*/
protected Symbol resultType;
/**
*
*
* @generated
*/
protected FunctionDefinitionImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return SolverLanguagePackage.Literals.FUNCTION_DEFINITION;
}
/**
*
*
* @generated
*/
public Symbol getResultType() {
if (resultType != null && resultType.eIsProxy()) {
InternalEObject oldResultType = (InternalEObject) resultType;
resultType = (Symbol) eResolveProxy(oldResultType);
if (resultType != oldResultType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
SolverLanguagePackage.FUNCTION_DEFINITION__RESULT_TYPE, oldResultType, resultType));
}
}
return resultType;
}
/**
*
*
* @generated
*/
public Symbol basicGetResultType() {
return resultType;
}
/**
*
*
* @generated
*/
public void setResultType(Symbol newResultType) {
Symbol oldResultType = resultType;
resultType = newResultType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
SolverLanguagePackage.FUNCTION_DEFINITION__RESULT_TYPE, oldResultType, resultType));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SolverLanguagePackage.FUNCTION_DEFINITION__RESULT_TYPE:
if (resolve)
return getResultType();
return basicGetResultType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SolverLanguagePackage.FUNCTION_DEFINITION__RESULT_TYPE:
setResultType((Symbol) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SolverLanguagePackage.FUNCTION_DEFINITION__RESULT_TYPE:
setResultType((Symbol) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SolverLanguagePackage.FUNCTION_DEFINITION__RESULT_TYPE:
return resultType != null;
}
return super.eIsSet(featureID);
}
} //FunctionDefinitionImpl