From e904f9d4b1d2d15ab4ec6d72ee881f4c7de34eef Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 15 May 2019 13:46:38 -0400 Subject: Formalize CPS case study for optimization --- .../domains/cps/impl/RequirementImpl.java | 387 +++++++++++++++++++++ 1 file changed, 387 insertions(+) create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java') diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java new file mode 100644 index 00000000..79dc4f62 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java @@ -0,0 +1,387 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.cps.impl; + +import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; +import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; +import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; +import hu.bme.mit.inf.dslreasoner.domains.cps.Request; +import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; + +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.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Requirement'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class RequirementImpl extends MinimalEObjectImpl.Container implements Requirement { + /** + * The default value of the '{@link #getCount() Count}' attribute. + * + * + * @see #getCount() + * @generated + * @ordered + */ + protected static final int COUNT_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getCount() Count}' attribute. + * + * + * @see #getCount() + * @generated + * @ordered + */ + protected int count = COUNT_EDEFAULT; + + /** + * The cached value of the '{@link #getType() Type}' reference. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected ApplicationType type; + + /** + * The cached value of the '{@link #getInstances() Instances}' reference list. + * + * + * @see #getInstances() + * @generated + * @ordered + */ + protected EList instances; + + /** + * + * + * @generated + */ + protected RequirementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.REQUIREMENT; + } + + /** + * + * + * @generated + */ + @Override + public Request getRequest() { + if (eContainerFeatureID() != CpsPackage.REQUIREMENT__REQUEST) + return null; + return (Request) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRequest(Request newRequest, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newRequest, CpsPackage.REQUIREMENT__REQUEST, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setRequest(Request newRequest) { + if (newRequest != eInternalContainer() + || (eContainerFeatureID() != CpsPackage.REQUIREMENT__REQUEST && newRequest != null)) { + if (EcoreUtil.isAncestor(this, newRequest)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newRequest != null) + msgs = ((InternalEObject) newRequest).eInverseAdd(this, CpsPackage.REQUEST__REQUIREMENTS, Request.class, + msgs); + msgs = basicSetRequest(newRequest, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__REQUEST, newRequest, + newRequest)); + } + + /** + * + * + * @generated + */ + @Override + public int getCount() { + return count; + } + + /** + * + * + * @generated + */ + @Override + public void setCount(int newCount) { + int oldCount = count; + count = newCount; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__COUNT, oldCount, count)); + } + + /** + * + * + * @generated + */ + @Override + public ApplicationType getType() { + if (type != null && type.eIsProxy()) { + InternalEObject oldType = (InternalEObject) type; + type = (ApplicationType) eResolveProxy(oldType); + if (type != oldType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, CpsPackage.REQUIREMENT__TYPE, oldType, + type)); + } + } + return type; + } + + /** + * + * + * @generated + */ + public ApplicationType basicGetType() { + return type; + } + + /** + * + * + * @generated + */ + @Override + public void setType(ApplicationType newType) { + ApplicationType oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__TYPE, oldType, type)); + } + + /** + * + * + * @generated + */ + @Override + public EList getInstances() { + if (instances == null) { + instances = new EObjectWithInverseResolvingEList(ApplicationInstance.class, this, + CpsPackage.REQUIREMENT__INSTANCES, CpsPackage.APPLICATION_INSTANCE__REQUIREMENT); + } + return instances; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.REQUIREMENT__REQUEST: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetRequest((Request) otherEnd, msgs); + case CpsPackage.REQUIREMENT__INSTANCES: + return ((InternalEList) (InternalEList) getInstances()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.REQUIREMENT__REQUEST: + return basicSetRequest(null, msgs); + case CpsPackage.REQUIREMENT__INSTANCES: + return ((InternalEList) getInstances()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case CpsPackage.REQUIREMENT__REQUEST: + return eInternalContainer().eInverseRemove(this, CpsPackage.REQUEST__REQUIREMENTS, Request.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.REQUIREMENT__REQUEST: + return getRequest(); + case CpsPackage.REQUIREMENT__COUNT: + return getCount(); + case CpsPackage.REQUIREMENT__TYPE: + if (resolve) + return getType(); + return basicGetType(); + case CpsPackage.REQUIREMENT__INSTANCES: + return getInstances(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.REQUIREMENT__REQUEST: + setRequest((Request) newValue); + return; + case CpsPackage.REQUIREMENT__COUNT: + setCount((Integer) newValue); + return; + case CpsPackage.REQUIREMENT__TYPE: + setType((ApplicationType) newValue); + return; + case CpsPackage.REQUIREMENT__INSTANCES: + getInstances().clear(); + getInstances().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.REQUIREMENT__REQUEST: + setRequest((Request) null); + return; + case CpsPackage.REQUIREMENT__COUNT: + setCount(COUNT_EDEFAULT); + return; + case CpsPackage.REQUIREMENT__TYPE: + setType((ApplicationType) null); + return; + case CpsPackage.REQUIREMENT__INSTANCES: + getInstances().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.REQUIREMENT__REQUEST: + return getRequest() != null; + case CpsPackage.REQUIREMENT__COUNT: + return count != COUNT_EDEFAULT; + case CpsPackage.REQUIREMENT__TYPE: + return type != null; + case CpsPackage.REQUIREMENT__INSTANCES: + return instances != null && !instances.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (count: "); + result.append(count); + result.append(')'); + return result.toString(); + } + +} //RequirementImpl -- cgit v1.2.3-70-g09d2