/**
* generated by Xtext 2.18.0.M3
*/
package org.eclipse.viatra.solver.language.solverLanguage.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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.AllInstances;
import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage;
import org.eclipse.viatra.solver.language.solverLanguage.Symbol;
/**
*
* An implementation of the model object 'All Instances'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.AllInstancesImpl#getSymbol Symbol}
*
*
* @generated
*/
public class AllInstancesImpl extends ComplexObjectImpl implements AllInstances
{
/**
* The cached value of the '{@link #getSymbol() Symbol}' containment reference.
*
*
* @see #getSymbol()
* @generated
* @ordered
*/
protected Symbol symbol;
/**
*
*
* @generated
*/
protected AllInstancesImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SolverLanguagePackage.Literals.ALL_INSTANCES;
}
/**
*
*
* @generated
*/
@Override
public Symbol getSymbol()
{
return symbol;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetSymbol(Symbol newSymbol, NotificationChain msgs)
{
Symbol oldSymbol = symbol;
symbol = newSymbol;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.ALL_INSTANCES__SYMBOL, oldSymbol, newSymbol);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setSymbol(Symbol newSymbol)
{
if (newSymbol != symbol)
{
NotificationChain msgs = null;
if (symbol != null)
msgs = ((InternalEObject)symbol).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.ALL_INSTANCES__SYMBOL, null, msgs);
if (newSymbol != null)
msgs = ((InternalEObject)newSymbol).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.ALL_INSTANCES__SYMBOL, null, msgs);
msgs = basicSetSymbol(newSymbol, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.ALL_INSTANCES__SYMBOL, newSymbol, newSymbol));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SolverLanguagePackage.ALL_INSTANCES__SYMBOL:
return basicSetSymbol(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SolverLanguagePackage.ALL_INSTANCES__SYMBOL:
return getSymbol();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SolverLanguagePackage.ALL_INSTANCES__SYMBOL:
setSymbol((Symbol)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SolverLanguagePackage.ALL_INSTANCES__SYMBOL:
setSymbol((Symbol)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SolverLanguagePackage.ALL_INSTANCES__SYMBOL:
return symbol != null;
}
return super.eIsSet(featureID);
}
} //AllInstancesImpl