/**
*/
package hu.bme.mit.inf.dslreasoner.faulttree.model.ft.impl;
import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.BasicEvent;
import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.Distribution;
import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.FtPackage;
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;
/**
*
* An implementation of the model object 'Basic Event'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.faulttree.model.ft.impl.BasicEventImpl#getDistribution Distribution}
*
*
* @generated
*/
public class BasicEventImpl extends RandomEventImpl implements BasicEvent {
/**
* The cached value of the '{@link #getDistribution() Distribution}' containment reference.
*
*
* @see #getDistribution()
* @generated
* @ordered
*/
protected Distribution distribution;
/**
*
*
* @generated
*/
protected BasicEventImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return FtPackage.Literals.BASIC_EVENT;
}
/**
*
*
* @generated
*/
@Override
public Distribution getDistribution() {
return distribution;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetDistribution(Distribution newDistribution, NotificationChain msgs) {
Distribution oldDistribution = distribution;
distribution = newDistribution;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FtPackage.BASIC_EVENT__DISTRIBUTION, oldDistribution, newDistribution);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setDistribution(Distribution newDistribution) {
if (newDistribution != distribution) {
NotificationChain msgs = null;
if (distribution != null)
msgs = ((InternalEObject)distribution).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FtPackage.BASIC_EVENT__DISTRIBUTION, null, msgs);
if (newDistribution != null)
msgs = ((InternalEObject)newDistribution).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FtPackage.BASIC_EVENT__DISTRIBUTION, null, msgs);
msgs = basicSetDistribution(newDistribution, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FtPackage.BASIC_EVENT__DISTRIBUTION, newDistribution, newDistribution));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FtPackage.BASIC_EVENT__DISTRIBUTION:
return basicSetDistribution(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FtPackage.BASIC_EVENT__DISTRIBUTION:
return getDistribution();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FtPackage.BASIC_EVENT__DISTRIBUTION:
setDistribution((Distribution)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FtPackage.BASIC_EVENT__DISTRIBUTION:
setDistribution((Distribution)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FtPackage.BASIC_EVENT__DISTRIBUTION:
return distribution != null;
}
return super.eIsSet(featureID);
}
} //BasicEventImpl