/**
* generated by Xtext 2.14.0
*/
package ca.mcgill.ecse.dslreasoner.vampireLanguage.impl;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSTerm;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage;
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.emf.ecore.impl.MinimalEObjectImpl;
/**
*
* An implementation of the model object 'VLS Fof Formula'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSFofFormulaImpl#getName Name}
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSFofFormulaImpl#getFofRole Fof Role}
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSFofFormulaImpl#getFofFormula Fof Formula}
* - {@link ca.mcgill.ecse.dslreasoner.vampireLanguage.impl.VLSFofFormulaImpl#getAnnotations Annotations}
*
*
* @generated
*/
public class VLSFofFormulaImpl extends MinimalEObjectImpl.Container implements VLSFofFormula
{
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getFofRole() Fof Role}' attribute.
*
*
* @see #getFofRole()
* @generated
* @ordered
*/
protected static final String FOF_ROLE_EDEFAULT = null;
/**
* The cached value of the '{@link #getFofRole() Fof Role}' attribute.
*
*
* @see #getFofRole()
* @generated
* @ordered
*/
protected String fofRole = FOF_ROLE_EDEFAULT;
/**
* The cached value of the '{@link #getFofFormula() Fof Formula}' containment reference.
*
*
* @see #getFofFormula()
* @generated
* @ordered
*/
protected VLSTerm fofFormula;
/**
* The cached value of the '{@link #getAnnotations() Annotations}' containment reference.
*
*
* @see #getAnnotations()
* @generated
* @ordered
*/
protected VLSAnnotation annotations;
/**
*
*
* @generated
*/
protected VLSFofFormulaImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return VampireLanguagePackage.Literals.VLS_FOF_FORMULA;
}
/**
*
*
* @generated
*/
public String getName()
{
return name;
}
/**
*
*
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_FOF_FORMULA__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public String getFofRole()
{
return fofRole;
}
/**
*
*
* @generated
*/
public void setFofRole(String newFofRole)
{
String oldFofRole = fofRole;
fofRole = newFofRole;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_FOF_FORMULA__FOF_ROLE, oldFofRole, fofRole));
}
/**
*
*
* @generated
*/
public VLSTerm getFofFormula()
{
return fofFormula;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetFofFormula(VLSTerm newFofFormula, NotificationChain msgs)
{
VLSTerm oldFofFormula = fofFormula;
fofFormula = newFofFormula;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA, oldFofFormula, newFofFormula);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setFofFormula(VLSTerm newFofFormula)
{
if (newFofFormula != fofFormula)
{
NotificationChain msgs = null;
if (fofFormula != null)
msgs = ((InternalEObject)fofFormula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA, null, msgs);
if (newFofFormula != null)
msgs = ((InternalEObject)newFofFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA, null, msgs);
msgs = basicSetFofFormula(newFofFormula, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA, newFofFormula, newFofFormula));
}
/**
*
*
* @generated
*/
public VLSAnnotation getAnnotations()
{
return annotations;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetAnnotations(VLSAnnotation newAnnotations, NotificationChain msgs)
{
VLSAnnotation oldAnnotations = annotations;
annotations = newAnnotations;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS, oldAnnotations, newAnnotations);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setAnnotations(VLSAnnotation newAnnotations)
{
if (newAnnotations != annotations)
{
NotificationChain msgs = null;
if (annotations != null)
msgs = ((InternalEObject)annotations).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS, null, msgs);
if (newAnnotations != null)
msgs = ((InternalEObject)newAnnotations).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS, null, msgs);
msgs = basicSetAnnotations(newAnnotations, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS, newAnnotations, newAnnotations));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA:
return basicSetFofFormula(null, msgs);
case VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS:
return basicSetAnnotations(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_FOF_FORMULA__NAME:
return getName();
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_ROLE:
return getFofRole();
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA:
return getFofFormula();
case VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS:
return getAnnotations();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_FOF_FORMULA__NAME:
setName((String)newValue);
return;
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_ROLE:
setFofRole((String)newValue);
return;
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA:
setFofFormula((VLSTerm)newValue);
return;
case VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS:
setAnnotations((VLSAnnotation)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_FOF_FORMULA__NAME:
setName(NAME_EDEFAULT);
return;
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_ROLE:
setFofRole(FOF_ROLE_EDEFAULT);
return;
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA:
setFofFormula((VLSTerm)null);
return;
case VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS:
setAnnotations((VLSAnnotation)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case VampireLanguagePackage.VLS_FOF_FORMULA__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_ROLE:
return FOF_ROLE_EDEFAULT == null ? fofRole != null : !FOF_ROLE_EDEFAULT.equals(fofRole);
case VampireLanguagePackage.VLS_FOF_FORMULA__FOF_FORMULA:
return fofFormula != null;
case VampireLanguagePackage.VLS_FOF_FORMULA__ANNOTATIONS:
return annotations != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", fofRole: ");
result.append(fofRole);
result.append(')');
return result.toString();
}
} //VLSFofFormulaImpl