From 615b602f0a9b4ce9eca8c38b9aa780b81d03d8e7 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 6 Feb 2019 18:28:18 +0100 Subject: Extract component fault tree model --- .../model/cft/impl/ComponentFaultTreeImpl.java | 218 +++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.model/ecore-gen/hu/bme/mit/inf/dslreasoner/faulttree/model/cft/impl/ComponentFaultTreeImpl.java (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.model/ecore-gen/hu/bme/mit/inf/dslreasoner/faulttree/model/cft/impl/ComponentFaultTreeImpl.java') diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.model/ecore-gen/hu/bme/mit/inf/dslreasoner/faulttree/model/cft/impl/ComponentFaultTreeImpl.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.model/ecore-gen/hu/bme/mit/inf/dslreasoner/faulttree/model/cft/impl/ComponentFaultTreeImpl.java new file mode 100644 index 00000000..b84b6436 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.model/ecore-gen/hu/bme/mit/inf/dslreasoner/faulttree/model/cft/impl/ComponentFaultTreeImpl.java @@ -0,0 +1,218 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.faulttree.model.cft.impl; + +import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftPackage; +import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Component; +import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; +import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; + +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 'Component Fault Tree'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class ComponentFaultTreeImpl extends MinimalEObjectImpl.Container implements ComponentFaultTree { + /** + * The cached value of the '{@link #getComponents() Components}' containment reference list. + * + * + * @see #getComponents() + * @generated + * @ordered + */ + protected EList components; + + /** + * The cached value of the '{@link #getTopEvent() Top Event}' reference. + * + * + * @see #getTopEvent() + * @generated + * @ordered + */ + protected Output topEvent; + + /** + * + * + * @generated + */ + protected ComponentFaultTreeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CftPackage.Literals.COMPONENT_FAULT_TREE; + } + + /** + * + * + * @generated + */ + @Override + public EList getComponents() { + if (components == null) { + components = new EObjectContainmentEList(Component.class, this, CftPackage.COMPONENT_FAULT_TREE__COMPONENTS); + } + return components; + } + + /** + * + * + * @generated + */ + @Override + public Output getTopEvent() { + if (topEvent != null && topEvent.eIsProxy()) { + InternalEObject oldTopEvent = (InternalEObject)topEvent; + topEvent = (Output)eResolveProxy(oldTopEvent); + if (topEvent != oldTopEvent) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, CftPackage.COMPONENT_FAULT_TREE__TOP_EVENT, oldTopEvent, topEvent)); + } + } + return topEvent; + } + + /** + * + * + * @generated + */ + public Output basicGetTopEvent() { + return topEvent; + } + + /** + * + * + * @generated + */ + @Override + public void setTopEvent(Output newTopEvent) { + Output oldTopEvent = topEvent; + topEvent = newTopEvent; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CftPackage.COMPONENT_FAULT_TREE__TOP_EVENT, oldTopEvent, topEvent)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CftPackage.COMPONENT_FAULT_TREE__COMPONENTS: + return ((InternalEList)getComponents()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CftPackage.COMPONENT_FAULT_TREE__COMPONENTS: + return getComponents(); + case CftPackage.COMPONENT_FAULT_TREE__TOP_EVENT: + if (resolve) return getTopEvent(); + return basicGetTopEvent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CftPackage.COMPONENT_FAULT_TREE__COMPONENTS: + getComponents().clear(); + getComponents().addAll((Collection)newValue); + return; + case CftPackage.COMPONENT_FAULT_TREE__TOP_EVENT: + setTopEvent((Output)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CftPackage.COMPONENT_FAULT_TREE__COMPONENTS: + getComponents().clear(); + return; + case CftPackage.COMPONENT_FAULT_TREE__TOP_EVENT: + setTopEvent((Output)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CftPackage.COMPONENT_FAULT_TREE__COMPONENTS: + return components != null && !components.isEmpty(); + case CftPackage.COMPONENT_FAULT_TREE__TOP_EVENT: + return topEvent != null; + } + return super.eIsSet(featureID); + } + +} //ComponentFaultTreeImpl -- cgit v1.2.3-70-g09d2