/** * generated by Xtext 2.16.0 */ package hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.impl; import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.CftLanguagePackage; import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.LookupDefinition; import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition; import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingParameter; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; 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.EObjectResolvingEList; /** * * An implementation of the model object 'Lookup Definition'. * *

* The following features are implemented: *

* * * @generated */ public class LookupDefinitionImpl extends VariableImpl implements LookupDefinition { /** * The cached value of the '{@link #getMapping() Mapping}' reference. * * * @see #getMapping() * @generated * @ordered */ protected MappingDefinition mapping; /** * The cached value of the '{@link #getArguments() Arguments}' reference list. * * * @see #getArguments() * @generated * @ordered */ protected EList arguments; /** * * * @generated */ protected LookupDefinitionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return CftLanguagePackage.Literals.LOOKUP_DEFINITION; } /** * * * @generated */ @Override public MappingDefinition getMapping() { if (mapping != null && mapping.eIsProxy()) { InternalEObject oldMapping = (InternalEObject)mapping; mapping = (MappingDefinition)eResolveProxy(oldMapping); if (mapping != oldMapping) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, CftLanguagePackage.LOOKUP_DEFINITION__MAPPING, oldMapping, mapping)); } } return mapping; } /** * * * @generated */ public MappingDefinition basicGetMapping() { return mapping; } /** * * * @generated */ @Override public void setMapping(MappingDefinition newMapping) { MappingDefinition oldMapping = mapping; mapping = newMapping; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CftLanguagePackage.LOOKUP_DEFINITION__MAPPING, oldMapping, mapping)); } /** * * * @generated */ @Override public EList getArguments() { if (arguments == null) { arguments = new EObjectResolvingEList(MappingParameter.class, this, CftLanguagePackage.LOOKUP_DEFINITION__ARGUMENTS); } return arguments; } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CftLanguagePackage.LOOKUP_DEFINITION__MAPPING: if (resolve) return getMapping(); return basicGetMapping(); case CftLanguagePackage.LOOKUP_DEFINITION__ARGUMENTS: return getArguments(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CftLanguagePackage.LOOKUP_DEFINITION__MAPPING: setMapping((MappingDefinition)newValue); return; case CftLanguagePackage.LOOKUP_DEFINITION__ARGUMENTS: getArguments().clear(); getArguments().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CftLanguagePackage.LOOKUP_DEFINITION__MAPPING: setMapping((MappingDefinition)null); return; case CftLanguagePackage.LOOKUP_DEFINITION__ARGUMENTS: getArguments().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CftLanguagePackage.LOOKUP_DEFINITION__MAPPING: return mapping != null; case CftLanguagePackage.LOOKUP_DEFINITION__ARGUMENTS: return arguments != null && !arguments.isEmpty(); } return super.eIsSet(featureID); } } //LookupDefinitionImpl