/**
*/
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.ExternFunctionDeclaration;
import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage;
import org.eclipse.viatra.solver.language.solverLanguage.Symbol;
/**
*
* An implementation of the model object 'Extern Function Declaration'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.ExternFunctionDeclarationImpl#getResultType Result Type}
*
*
* @generated
*/
public class ExternFunctionDeclarationImpl extends ExternFunctorDeclarationImpl implements ExternFunctionDeclaration {
/**
* The cached value of the '{@link #getResultType() Result Type}' reference.
*
*
* @see #getResultType()
* @generated
* @ordered
*/
protected Symbol resultType;
/**
*
*
* @generated
*/
protected ExternFunctionDeclarationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return SolverLanguagePackage.Literals.EXTERN_FUNCTION_DECLARATION;
}
/**
*
*
* @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.EXTERN_FUNCTION_DECLARATION__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.EXTERN_FUNCTION_DECLARATION__RESULT_TYPE, oldResultType, resultType));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SolverLanguagePackage.EXTERN_FUNCTION_DECLARATION__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.EXTERN_FUNCTION_DECLARATION__RESULT_TYPE:
setResultType((Symbol) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SolverLanguagePackage.EXTERN_FUNCTION_DECLARATION__RESULT_TYPE:
setResultType((Symbol) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SolverLanguagePackage.EXTERN_FUNCTION_DECLARATION__RESULT_TYPE:
return resultType != null;
}
return super.eIsSet(featureID);
}
} //ExternFunctionDeclarationImpl