/** */ package hu.bme.mit.inf.dslreasoner.alloyLanguage.impl; import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSDocument; import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSEnumDeclaration; import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSFactDeclaration; import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSFunctionDefinition; import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSRelationDefinition; import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSRunCommand; import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSSignatureBody; import hu.bme.mit.inf.dslreasoner.alloyLanguage.AlloyLanguagePackage; 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.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * * An implementation of the model object 'ALS Document'. * *

* The following features are implemented: *

* * * @generated */ public class ALSDocumentImpl extends MinimalEObjectImpl.Container implements ALSDocument { /** * The cached value of the '{@link #getEnumDeclarations() Enum Declarations}' containment reference list. * * * @see #getEnumDeclarations() * @generated * @ordered */ protected EList enumDeclarations; /** * The cached value of the '{@link #getSignatureBodies() Signature Bodies}' containment reference list. * * * @see #getSignatureBodies() * @generated * @ordered */ protected EList signatureBodies; /** * The cached value of the '{@link #getFunctionDefinitions() Function Definitions}' containment reference list. * * * @see #getFunctionDefinitions() * @generated * @ordered */ protected EList functionDefinitions; /** * The cached value of the '{@link #getRelationDefinitions() Relation Definitions}' containment reference list. * * * @see #getRelationDefinitions() * @generated * @ordered */ protected EList relationDefinitions; /** * The cached value of the '{@link #getFactDeclarations() Fact Declarations}' containment reference list. * * * @see #getFactDeclarations() * @generated * @ordered */ protected EList factDeclarations; /** * The cached value of the '{@link #getRunCommand() Run Command}' containment reference. * * * @see #getRunCommand() * @generated * @ordered */ protected ALSRunCommand runCommand; /** * * * @generated */ protected ALSDocumentImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return AlloyLanguagePackage.Literals.ALS_DOCUMENT; } /** * * * @generated */ public EList getEnumDeclarations() { if (enumDeclarations == null) { enumDeclarations = new EObjectContainmentEList(ALSEnumDeclaration.class, this, AlloyLanguagePackage.ALS_DOCUMENT__ENUM_DECLARATIONS); } return enumDeclarations; } /** * * * @generated */ public EList getSignatureBodies() { if (signatureBodies == null) { signatureBodies = new EObjectContainmentEList(ALSSignatureBody.class, this, AlloyLanguagePackage.ALS_DOCUMENT__SIGNATURE_BODIES); } return signatureBodies; } /** * * * @generated */ public EList getFunctionDefinitions() { if (functionDefinitions == null) { functionDefinitions = new EObjectContainmentEList(ALSFunctionDefinition.class, this, AlloyLanguagePackage.ALS_DOCUMENT__FUNCTION_DEFINITIONS); } return functionDefinitions; } /** * * * @generated */ public EList getRelationDefinitions() { if (relationDefinitions == null) { relationDefinitions = new EObjectContainmentEList(ALSRelationDefinition.class, this, AlloyLanguagePackage.ALS_DOCUMENT__RELATION_DEFINITIONS); } return relationDefinitions; } /** * * * @generated */ public EList getFactDeclarations() { if (factDeclarations == null) { factDeclarations = new EObjectContainmentEList(ALSFactDeclaration.class, this, AlloyLanguagePackage.ALS_DOCUMENT__FACT_DECLARATIONS); } return factDeclarations; } /** * * * @generated */ public ALSRunCommand getRunCommand() { return runCommand; } /** * * * @generated */ public NotificationChain basicSetRunCommand(ALSRunCommand newRunCommand, NotificationChain msgs) { ALSRunCommand oldRunCommand = runCommand; runCommand = newRunCommand; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND, oldRunCommand, newRunCommand); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setRunCommand(ALSRunCommand newRunCommand) { if (newRunCommand != runCommand) { NotificationChain msgs = null; if (runCommand != null) msgs = ((InternalEObject)runCommand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND, null, msgs); if (newRunCommand != null) msgs = ((InternalEObject)newRunCommand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND, null, msgs); msgs = basicSetRunCommand(newRunCommand, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND, newRunCommand, newRunCommand)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AlloyLanguagePackage.ALS_DOCUMENT__ENUM_DECLARATIONS: return ((InternalEList)getEnumDeclarations()).basicRemove(otherEnd, msgs); case AlloyLanguagePackage.ALS_DOCUMENT__SIGNATURE_BODIES: return ((InternalEList)getSignatureBodies()).basicRemove(otherEnd, msgs); case AlloyLanguagePackage.ALS_DOCUMENT__FUNCTION_DEFINITIONS: return ((InternalEList)getFunctionDefinitions()).basicRemove(otherEnd, msgs); case AlloyLanguagePackage.ALS_DOCUMENT__RELATION_DEFINITIONS: return ((InternalEList)getRelationDefinitions()).basicRemove(otherEnd, msgs); case AlloyLanguagePackage.ALS_DOCUMENT__FACT_DECLARATIONS: return ((InternalEList)getFactDeclarations()).basicRemove(otherEnd, msgs); case AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND: return basicSetRunCommand(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AlloyLanguagePackage.ALS_DOCUMENT__ENUM_DECLARATIONS: return getEnumDeclarations(); case AlloyLanguagePackage.ALS_DOCUMENT__SIGNATURE_BODIES: return getSignatureBodies(); case AlloyLanguagePackage.ALS_DOCUMENT__FUNCTION_DEFINITIONS: return getFunctionDefinitions(); case AlloyLanguagePackage.ALS_DOCUMENT__RELATION_DEFINITIONS: return getRelationDefinitions(); case AlloyLanguagePackage.ALS_DOCUMENT__FACT_DECLARATIONS: return getFactDeclarations(); case AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND: return getRunCommand(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AlloyLanguagePackage.ALS_DOCUMENT__ENUM_DECLARATIONS: getEnumDeclarations().clear(); getEnumDeclarations().addAll((Collection)newValue); return; case AlloyLanguagePackage.ALS_DOCUMENT__SIGNATURE_BODIES: getSignatureBodies().clear(); getSignatureBodies().addAll((Collection)newValue); return; case AlloyLanguagePackage.ALS_DOCUMENT__FUNCTION_DEFINITIONS: getFunctionDefinitions().clear(); getFunctionDefinitions().addAll((Collection)newValue); return; case AlloyLanguagePackage.ALS_DOCUMENT__RELATION_DEFINITIONS: getRelationDefinitions().clear(); getRelationDefinitions().addAll((Collection)newValue); return; case AlloyLanguagePackage.ALS_DOCUMENT__FACT_DECLARATIONS: getFactDeclarations().clear(); getFactDeclarations().addAll((Collection)newValue); return; case AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND: setRunCommand((ALSRunCommand)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case AlloyLanguagePackage.ALS_DOCUMENT__ENUM_DECLARATIONS: getEnumDeclarations().clear(); return; case AlloyLanguagePackage.ALS_DOCUMENT__SIGNATURE_BODIES: getSignatureBodies().clear(); return; case AlloyLanguagePackage.ALS_DOCUMENT__FUNCTION_DEFINITIONS: getFunctionDefinitions().clear(); return; case AlloyLanguagePackage.ALS_DOCUMENT__RELATION_DEFINITIONS: getRelationDefinitions().clear(); return; case AlloyLanguagePackage.ALS_DOCUMENT__FACT_DECLARATIONS: getFactDeclarations().clear(); return; case AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND: setRunCommand((ALSRunCommand)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case AlloyLanguagePackage.ALS_DOCUMENT__ENUM_DECLARATIONS: return enumDeclarations != null && !enumDeclarations.isEmpty(); case AlloyLanguagePackage.ALS_DOCUMENT__SIGNATURE_BODIES: return signatureBodies != null && !signatureBodies.isEmpty(); case AlloyLanguagePackage.ALS_DOCUMENT__FUNCTION_DEFINITIONS: return functionDefinitions != null && !functionDefinitions.isEmpty(); case AlloyLanguagePackage.ALS_DOCUMENT__RELATION_DEFINITIONS: return relationDefinitions != null && !relationDefinitions.isEmpty(); case AlloyLanguagePackage.ALS_DOCUMENT__FACT_DECLARATIONS: return factDeclarations != null && !factDeclarations.isEmpty(); case AlloyLanguagePackage.ALS_DOCUMENT__RUN_COMMAND: return runCommand != null; } return super.eIsSet(featureID); } } //ALSDocumentImpl