/**
*/
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.Datatype;
import org.eclipse.viatra.solver.language.solverLanguage.Function;
import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage;
/**
*
* An implementation of the model object 'Function'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.FunctionImpl#getResultType Result Type}
*
*
* @generated
*/
public abstract class FunctionImpl extends FunctorImpl implements Function {
/**
* The cached value of the '{@link #getResultType() Result Type}' reference.
*
*
* @see #getResultType()
* @generated
* @ordered
*/
protected Datatype resultType;
/**
*
*
* @generated
*/
protected FunctionImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return SolverLanguagePackage.Literals.FUNCTION;
}
/**
*
*
* @generated
*/
public Datatype getResultType() {
if (resultType != null && resultType.eIsProxy()) {
InternalEObject oldResultType = (InternalEObject) resultType;
resultType = (Datatype) eResolveProxy(oldResultType);
if (resultType != oldResultType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
SolverLanguagePackage.FUNCTION__RESULT_TYPE, oldResultType, resultType));
}
}
return resultType;
}
/**
*
*
* @generated
*/
public Datatype basicGetResultType() {
return resultType;
}
/**
*
*
* @generated
*/
public void setResultType(Datatype newResultType) {
Datatype oldResultType = resultType;
resultType = newResultType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.FUNCTION__RESULT_TYPE,
oldResultType, resultType));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SolverLanguagePackage.FUNCTION__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__RESULT_TYPE:
setResultType((Datatype) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SolverLanguagePackage.FUNCTION__RESULT_TYPE:
setResultType((Datatype) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SolverLanguagePackage.FUNCTION__RESULT_TYPE:
return resultType != null;
}
return super.eIsSet(featureID);
}
} //FunctionImpl