/**
* 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.EventReference;
import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.Variable;
import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDeclaration;
import org.eclipse.emf.common.notify.Notification;
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 'Event Reference'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.impl.EventReferenceImpl#getComponent Component}
* - {@link hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.impl.EventReferenceImpl#getEvent Event}
*
*
* @generated
*/
public class EventReferenceImpl extends MinimalEObjectImpl.Container implements EventReference
{
/**
* The cached value of the '{@link #getComponent() Component}' reference.
*
*
* @see #getComponent()
* @generated
* @ordered
*/
protected Variable component;
/**
* The cached value of the '{@link #getEvent() Event}' reference.
*
*
* @see #getEvent()
* @generated
* @ordered
*/
protected EventDeclaration event;
/**
*
*
* @generated
*/
protected EventReferenceImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return CftLanguagePackage.Literals.EVENT_REFERENCE;
}
/**
*
*
* @generated
*/
@Override
public Variable getComponent()
{
if (component != null && component.eIsProxy())
{
InternalEObject oldComponent = (InternalEObject)component;
component = (Variable)eResolveProxy(oldComponent);
if (component != oldComponent)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CftLanguagePackage.EVENT_REFERENCE__COMPONENT, oldComponent, component));
}
}
return component;
}
/**
*
*
* @generated
*/
public Variable basicGetComponent()
{
return component;
}
/**
*
*
* @generated
*/
@Override
public void setComponent(Variable newComponent)
{
Variable oldComponent = component;
component = newComponent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CftLanguagePackage.EVENT_REFERENCE__COMPONENT, oldComponent, component));
}
/**
*
*
* @generated
*/
@Override
public EventDeclaration getEvent()
{
if (event != null && event.eIsProxy())
{
InternalEObject oldEvent = (InternalEObject)event;
event = (EventDeclaration)eResolveProxy(oldEvent);
if (event != oldEvent)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CftLanguagePackage.EVENT_REFERENCE__EVENT, oldEvent, event));
}
}
return event;
}
/**
*
*
* @generated
*/
public EventDeclaration basicGetEvent()
{
return event;
}
/**
*
*
* @generated
*/
@Override
public void setEvent(EventDeclaration newEvent)
{
EventDeclaration oldEvent = event;
event = newEvent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CftLanguagePackage.EVENT_REFERENCE__EVENT, oldEvent, event));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case CftLanguagePackage.EVENT_REFERENCE__COMPONENT:
if (resolve) return getComponent();
return basicGetComponent();
case CftLanguagePackage.EVENT_REFERENCE__EVENT:
if (resolve) return getEvent();
return basicGetEvent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case CftLanguagePackage.EVENT_REFERENCE__COMPONENT:
setComponent((Variable)newValue);
return;
case CftLanguagePackage.EVENT_REFERENCE__EVENT:
setEvent((EventDeclaration)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case CftLanguagePackage.EVENT_REFERENCE__COMPONENT:
setComponent((Variable)null);
return;
case CftLanguagePackage.EVENT_REFERENCE__EVENT:
setEvent((EventDeclaration)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case CftLanguagePackage.EVENT_REFERENCE__COMPONENT:
return component != null;
case CftLanguagePackage.EVENT_REFERENCE__EVENT:
return event != null;
}
return super.eIsSet(featureID);
}
} //EventReferenceImpl