/**
*/
package org.eclipse.viatra.solver.language.model.problem.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.model.problem.Parameter;
import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
import org.eclipse.viatra.solver.language.model.problem.Relation;
/**
*
* An implementation of the model object 'Parameter'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.model.problem.impl.ParameterImpl#getParameterType Parameter Type}
*
*
* @generated
*/
public class ParameterImpl extends VariableImpl implements Parameter {
/**
* The cached value of the '{@link #getParameterType() Parameter Type}' reference.
*
*
* @see #getParameterType()
* @generated
* @ordered
*/
protected Relation parameterType;
/**
*
*
* @generated
*/
protected ParameterImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ProblemPackage.Literals.PARAMETER;
}
/**
*
*
* @generated
*/
public Relation getParameterType() {
if (parameterType != null && parameterType.eIsProxy()) {
InternalEObject oldParameterType = (InternalEObject) parameterType;
parameterType = (Relation) eResolveProxy(oldParameterType);
if (parameterType != oldParameterType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProblemPackage.PARAMETER__PARAMETER_TYPE,
oldParameterType, parameterType));
}
}
return parameterType;
}
/**
*
*
* @generated
*/
public Relation basicGetParameterType() {
return parameterType;
}
/**
*
*
* @generated
*/
public void setParameterType(Relation newParameterType) {
Relation oldParameterType = parameterType;
parameterType = newParameterType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProblemPackage.PARAMETER__PARAMETER_TYPE,
oldParameterType, parameterType));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ProblemPackage.PARAMETER__PARAMETER_TYPE:
if (resolve)
return getParameterType();
return basicGetParameterType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ProblemPackage.PARAMETER__PARAMETER_TYPE:
setParameterType((Relation) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ProblemPackage.PARAMETER__PARAMETER_TYPE:
setParameterType((Relation) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ProblemPackage.PARAMETER__PARAMETER_TYPE:
return parameterType != null;
}
return super.eIsSet(featureID);
}
} //ParameterImpl