/**
*/
package hu.bme.mit.inf.dslreasoner.smtLanguage.impl;
import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTInlineConstantDefinition;
import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTLet;
import hu.bme.mit.inf.dslreasoner.smtLanguage.SMTTerm;
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 Let'.
*
*
* The following features are implemented:
*
* - {@link hu.bme.mit.inf.dslreasoner.smtLanguage.impl.SMTLetImpl#getInlineConstantDefinitions Inline Constant Definitions}
* - {@link hu.bme.mit.inf.dslreasoner.smtLanguage.impl.SMTLetImpl#getTerm Term}
*
*
*
* @generated
*/
public class SMTLetImpl extends SMTTermImpl implements SMTLet
{
/**
* The cached value of the '{@link #getInlineConstantDefinitions() Inline Constant Definitions}' containment reference list.
*
*
* @see #getInlineConstantDefinitions()
* @generated
* @ordered
*/
protected EList inlineConstantDefinitions;
/**
* The cached value of the '{@link #getTerm() Term}' containment reference.
*
*
* @see #getTerm()
* @generated
* @ordered
*/
protected SMTTerm term;
/**
*
*
* @generated
*/
protected SMTLetImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SmtLanguagePackage.Literals.SMT_LET;
}
/**
*
*
* @generated
*/
public EList getInlineConstantDefinitions()
{
if (inlineConstantDefinitions == null)
{
inlineConstantDefinitions = new EObjectContainmentEList(SMTInlineConstantDefinition.class, this, SmtLanguagePackage.SMT_LET__INLINE_CONSTANT_DEFINITIONS);
}
return inlineConstantDefinitions;
}
/**
*
*
* @generated
*/
public SMTTerm getTerm()
{
return term;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTerm(SMTTerm newTerm, NotificationChain msgs)
{
SMTTerm oldTerm = term;
term = newTerm;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_LET__TERM, oldTerm, newTerm);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTerm(SMTTerm newTerm)
{
if (newTerm != term)
{
NotificationChain msgs = null;
if (term != null)
msgs = ((InternalEObject)term).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_LET__TERM, null, msgs);
if (newTerm != null)
msgs = ((InternalEObject)newTerm).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SmtLanguagePackage.SMT_LET__TERM, null, msgs);
msgs = basicSetTerm(newTerm, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SmtLanguagePackage.SMT_LET__TERM, newTerm, newTerm));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_LET__INLINE_CONSTANT_DEFINITIONS:
return ((InternalEList>)getInlineConstantDefinitions()).basicRemove(otherEnd, msgs);
case SmtLanguagePackage.SMT_LET__TERM:
return basicSetTerm(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_LET__INLINE_CONSTANT_DEFINITIONS:
return getInlineConstantDefinitions();
case SmtLanguagePackage.SMT_LET__TERM:
return getTerm();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_LET__INLINE_CONSTANT_DEFINITIONS:
getInlineConstantDefinitions().clear();
getInlineConstantDefinitions().addAll((Collection extends SMTInlineConstantDefinition>)newValue);
return;
case SmtLanguagePackage.SMT_LET__TERM:
setTerm((SMTTerm)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_LET__INLINE_CONSTANT_DEFINITIONS:
getInlineConstantDefinitions().clear();
return;
case SmtLanguagePackage.SMT_LET__TERM:
setTerm((SMTTerm)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SmtLanguagePackage.SMT_LET__INLINE_CONSTANT_DEFINITIONS:
return inlineConstantDefinitions != null && !inlineConstantDefinitions.isEmpty();
case SmtLanguagePackage.SMT_LET__TERM:
return term != null;
}
return super.eIsSet(featureID);
}
} //SMTLetImpl