/**
*/
package hu.bme.mit.inf.dslreasoner.smtLanguage.impl;
import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTFunctionDeclaration;
import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTTypeReference;
import hu.bme.mit.inf.dslreasoner.smtLanguage.SmtLanguagePackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'SMT Function Declaration'.
*
*
* The following features are implemented:
*
* - {@link hu.bme.mit.inf.dslreasoner.smtLanguage.impl.SMTFunctionDeclarationImpl#getParameters Parameters}
* - {@link hu.bme.mit.inf.dslreasoner.smtLanguage.impl.SMTFunctionDeclarationImpl#getRange Range}
*
*
*
* @generated
*/
public class SMTFunctionDeclarationImpl extends SMTSymbolicDeclarationImpl implements SMTFunctionDeclaration
{
/**
* The cached value of the '{@link #getParameters() Parameters}' containment reference list.
*
*
* @see #getParameters()
* @generated
* @ordered
*/
protected EList parameters;
/**
* The cached value of the '{@link #getRange() Range}' containment reference.
*
*
* @see #getRange()
* @generated
* @ordered
*/
protected SMTTypeReference range;
/**
*
*
* @generated
*/
protected SMTFunctionDeclarationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SmtLanguagePackage.Literals.SMT_FUNCTION_DECLARATION;
}
/**
*
*
* @generated
*/
public EList getParameters()
{
if (parameters == null)
{
parameters = new EObjectContainmentEList(SMTTypeReference.class, this, SmtLanguagePackage.SMT_FUNCTION_DECLARATION__PARAMETERS);
}
return parameters;
}
/**
*
*
* @generated
*/
public SMTTypeReference getRange()
{
return range;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetRange(SMTTypeReference newRange, NotificationChain msgs)
{
SMTTypeReference oldRange = range;
range = newRange;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE, oldRange, newRange);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setRange(SMTTypeReference newRange)
{
if (newRange != range)
{
NotificationChain msgs = null;
if (range != null)
msgs = ((InternalEObject)range).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE, null, msgs);
if (newRange != null)
msgs = ((InternalEObject)newRange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE, null, msgs);
msgs = basicSetRange(newRange, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE, newRange, newRange));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__PARAMETERS:
return ((InternalEList>)getParameters()).basicRemove(otherEnd, msgs);
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE:
return basicSetRange(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__PARAMETERS:
return getParameters();
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE:
return getRange();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__PARAMETERS:
getParameters().clear();
getParameters().addAll((Collection extends SMTTypeReference>)newValue);
return;
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE:
setRange((SMTTypeReference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__PARAMETERS:
getParameters().clear();
return;
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE:
setRange((SMTTypeReference)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__PARAMETERS:
return parameters != null && !parameters.isEmpty();
case SmtLanguagePackage.SMT_FUNCTION_DECLARATION__RANGE:
return range != null;
}
return super.eIsSet(featureID);
}
} //SMTFunctionDeclarationImpl