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/ApplicationInstanceImpl.java | 405 +++++++++++ .../domains/cps/impl/ApplicationTypeImpl.java | 209 ++++++ .../domains/cps/impl/CpsFactoryImpl.java | 188 +++++ .../domains/cps/impl/CpsPackageImpl.java | 765 +++++++++++++++++++++ .../domains/cps/impl/CyberPhysicalSystemImpl.java | 289 ++++++++ .../domains/cps/impl/HostInstanceImpl.java | 355 ++++++++++ .../dslreasoner/domains/cps/impl/HostTypeImpl.java | 356 ++++++++++ .../dslreasoner/domains/cps/impl/RequestImpl.java | 169 +++++ .../domains/cps/impl/RequirementImpl.java | 387 +++++++++++ .../domains/cps/impl/ResourceRequirementImpl.java | 291 ++++++++ 10 files changed, 3414 insertions(+) create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl') diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java new file mode 100644 index 00000000..cea2d6f4 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java @@ -0,0 +1,405 @@ +/** + */ +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.HostInstance; +import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; + +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; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EcoreUtil; + +/** + * + * An implementation of the model object 'Application Instance'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class ApplicationInstanceImpl extends MinimalEObjectImpl.Container implements ApplicationInstance { + /** + * The cached value of the '{@link #getRequirement() Requirement}' reference. + * + * + * @see #getRequirement() + * @generated + * @ordered + */ + protected Requirement requirement; + + /** + * The cached value of the '{@link #getAllocatedTo() Allocated To}' reference. + * + * + * @see #getAllocatedTo() + * @generated + * @ordered + */ + protected HostInstance allocatedTo; + + /** + * + * + * @generated + */ + protected ApplicationInstanceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.APPLICATION_INSTANCE; + } + + /** + * + * + * @generated + */ + @Override + public Requirement getRequirement() { + if (requirement != null && requirement.eIsProxy()) { + InternalEObject oldRequirement = (InternalEObject) requirement; + requirement = (Requirement) eResolveProxy(oldRequirement); + if (requirement != oldRequirement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, oldRequirement, requirement)); + } + } + return requirement; + } + + /** + * + * + * @generated + */ + public Requirement basicGetRequirement() { + return requirement; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRequirement(Requirement newRequirement, NotificationChain msgs) { + Requirement oldRequirement = requirement; + requirement = newRequirement; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, oldRequirement, newRequirement); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setRequirement(Requirement newRequirement) { + if (newRequirement != requirement) { + NotificationChain msgs = null; + if (requirement != null) + msgs = ((InternalEObject) requirement).eInverseRemove(this, CpsPackage.REQUIREMENT__INSTANCES, + Requirement.class, msgs); + if (newRequirement != null) + msgs = ((InternalEObject) newRequirement).eInverseAdd(this, CpsPackage.REQUIREMENT__INSTANCES, + Requirement.class, msgs); + msgs = basicSetRequirement(newRequirement, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, + newRequirement, newRequirement)); + } + + /** + * + * + * @generated + */ + @Override + public ApplicationType getType() { + if (eContainerFeatureID() != CpsPackage.APPLICATION_INSTANCE__TYPE) + return null; + return (ApplicationType) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetType(ApplicationType newType, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.APPLICATION_INSTANCE__TYPE, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setType(ApplicationType newType) { + if (newType != eInternalContainer() + || (eContainerFeatureID() != CpsPackage.APPLICATION_INSTANCE__TYPE && newType != null)) { + if (EcoreUtil.isAncestor(this, newType)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newType != null) + msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.APPLICATION_TYPE__INSTANCES, + ApplicationType.class, msgs); + msgs = basicSetType(newType, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__TYPE, newType, + newType)); + } + + /** + * + * + * @generated + */ + @Override + public HostInstance getAllocatedTo() { + if (allocatedTo != null && allocatedTo.eIsProxy()) { + InternalEObject oldAllocatedTo = (InternalEObject) allocatedTo; + allocatedTo = (HostInstance) eResolveProxy(oldAllocatedTo); + if (allocatedTo != oldAllocatedTo) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, oldAllocatedTo, allocatedTo)); + } + } + return allocatedTo; + } + + /** + * + * + * @generated + */ + public HostInstance basicGetAllocatedTo() { + return allocatedTo; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAllocatedTo(HostInstance newAllocatedTo, NotificationChain msgs) { + HostInstance oldAllocatedTo = allocatedTo; + allocatedTo = newAllocatedTo; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, oldAllocatedTo, newAllocatedTo); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setAllocatedTo(HostInstance newAllocatedTo) { + if (newAllocatedTo != allocatedTo) { + NotificationChain msgs = null; + if (allocatedTo != null) + msgs = ((InternalEObject) allocatedTo).eInverseRemove(this, CpsPackage.HOST_INSTANCE__APPLICATIONS, + HostInstance.class, msgs); + if (newAllocatedTo != null) + msgs = ((InternalEObject) newAllocatedTo).eInverseAdd(this, CpsPackage.HOST_INSTANCE__APPLICATIONS, + HostInstance.class, msgs); + msgs = basicSetAllocatedTo(newAllocatedTo, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, + newAllocatedTo, newAllocatedTo)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: + if (requirement != null) + msgs = ((InternalEObject) requirement).eInverseRemove(this, CpsPackage.REQUIREMENT__INSTANCES, + Requirement.class, msgs); + return basicSetRequirement((Requirement) otherEnd, msgs); + case CpsPackage.APPLICATION_INSTANCE__TYPE: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetType((ApplicationType) otherEnd, msgs); + case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: + if (allocatedTo != null) + msgs = ((InternalEObject) allocatedTo).eInverseRemove(this, CpsPackage.HOST_INSTANCE__APPLICATIONS, + HostInstance.class, msgs); + return basicSetAllocatedTo((HostInstance) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: + return basicSetRequirement(null, msgs); + case CpsPackage.APPLICATION_INSTANCE__TYPE: + return basicSetType(null, msgs); + case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: + return basicSetAllocatedTo(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case CpsPackage.APPLICATION_INSTANCE__TYPE: + return eInternalContainer().eInverseRemove(this, CpsPackage.APPLICATION_TYPE__INSTANCES, + ApplicationType.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: + if (resolve) + return getRequirement(); + return basicGetRequirement(); + case CpsPackage.APPLICATION_INSTANCE__TYPE: + return getType(); + case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: + if (resolve) + return getAllocatedTo(); + return basicGetAllocatedTo(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: + setRequirement((Requirement) newValue); + return; + case CpsPackage.APPLICATION_INSTANCE__TYPE: + setType((ApplicationType) newValue); + return; + case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: + setAllocatedTo((HostInstance) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: + setRequirement((Requirement) null); + return; + case CpsPackage.APPLICATION_INSTANCE__TYPE: + setType((ApplicationType) null); + return; + case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: + setAllocatedTo((HostInstance) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: + return requirement != null; + case CpsPackage.APPLICATION_INSTANCE__TYPE: + return getType() != null; + case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: + return allocatedTo != null; + } + return super.eIsSet(featureID); + } + +} //ApplicationInstanceImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java new file mode 100644 index 00000000..f8793e30 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java @@ -0,0 +1,209 @@ +/** + */ +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.ResourceRequirement; + +import java.util.Collection; + +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.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Application Type'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class ApplicationTypeImpl extends MinimalEObjectImpl.Container implements ApplicationType { + /** + * The cached value of the '{@link #getInstances() Instances}' containment reference list. + * + * + * @see #getInstances() + * @generated + * @ordered + */ + protected EList instances; + + /** + * The cached value of the '{@link #getRequirements() Requirements}' containment reference list. + * + * + * @see #getRequirements() + * @generated + * @ordered + */ + protected EList requirements; + + /** + * + * + * @generated + */ + protected ApplicationTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.APPLICATION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public EList getInstances() { + if (instances == null) { + instances = new EObjectContainmentWithInverseEList(ApplicationInstance.class, this, + CpsPackage.APPLICATION_TYPE__INSTANCES, CpsPackage.APPLICATION_INSTANCE__TYPE); + } + return instances; + } + + /** + * + * + * @generated + */ + @Override + public EList getRequirements() { + if (requirements == null) { + requirements = new EObjectContainmentEList(ResourceRequirement.class, this, + CpsPackage.APPLICATION_TYPE__REQUIREMENTS); + } + return requirements; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.APPLICATION_TYPE__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.APPLICATION_TYPE__INSTANCES: + return ((InternalEList) getInstances()).basicRemove(otherEnd, msgs); + case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: + return ((InternalEList) getRequirements()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.APPLICATION_TYPE__INSTANCES: + return getInstances(); + case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: + return getRequirements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.APPLICATION_TYPE__INSTANCES: + getInstances().clear(); + getInstances().addAll((Collection) newValue); + return; + case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: + getRequirements().clear(); + getRequirements().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.APPLICATION_TYPE__INSTANCES: + getInstances().clear(); + return; + case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: + getRequirements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.APPLICATION_TYPE__INSTANCES: + return instances != null && !instances.isEmpty(); + case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: + return requirements != null && !requirements.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ApplicationTypeImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java new file mode 100644 index 00000000..110f5abb --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java @@ -0,0 +1,188 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.cps.impl; + +import hu.bme.mit.inf.dslreasoner.domains.cps.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class CpsFactoryImpl extends EFactoryImpl implements CpsFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static CpsFactory init() { + try { + CpsFactory theCpsFactory = (CpsFactory) EPackage.Registry.INSTANCE.getEFactory(CpsPackage.eNS_URI); + if (theCpsFactory != null) { + return theCpsFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new CpsFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public CpsFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case CpsPackage.CYBER_PHYSICAL_SYSTEM: + return createCyberPhysicalSystem(); + case CpsPackage.APPLICATION_TYPE: + return createApplicationType(); + case CpsPackage.HOST_TYPE: + return createHostType(); + case CpsPackage.REQUEST: + return createRequest(); + case CpsPackage.REQUIREMENT: + return createRequirement(); + case CpsPackage.APPLICATION_INSTANCE: + return createApplicationInstance(); + case CpsPackage.RESOURCE_REQUIREMENT: + return createResourceRequirement(); + case CpsPackage.HOST_INSTANCE: + return createHostInstance(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public CyberPhysicalSystem createCyberPhysicalSystem() { + CyberPhysicalSystemImpl cyberPhysicalSystem = new CyberPhysicalSystemImpl(); + return cyberPhysicalSystem; + } + + /** + * + * + * @generated + */ + @Override + public ApplicationType createApplicationType() { + ApplicationTypeImpl applicationType = new ApplicationTypeImpl(); + return applicationType; + } + + /** + * + * + * @generated + */ + @Override + public HostType createHostType() { + HostTypeImpl hostType = new HostTypeImpl(); + return hostType; + } + + /** + * + * + * @generated + */ + @Override + public Request createRequest() { + RequestImpl request = new RequestImpl(); + return request; + } + + /** + * + * + * @generated + */ + @Override + public Requirement createRequirement() { + RequirementImpl requirement = new RequirementImpl(); + return requirement; + } + + /** + * + * + * @generated + */ + @Override + public ApplicationInstance createApplicationInstance() { + ApplicationInstanceImpl applicationInstance = new ApplicationInstanceImpl(); + return applicationInstance; + } + + /** + * + * + * @generated + */ + @Override + public ResourceRequirement createResourceRequirement() { + ResourceRequirementImpl resourceRequirement = new ResourceRequirementImpl(); + return resourceRequirement; + } + + /** + * + * + * @generated + */ + @Override + public HostInstance createHostInstance() { + HostInstanceImpl hostInstance = new HostInstanceImpl(); + return hostInstance; + } + + /** + * + * + * @generated + */ + @Override + public CpsPackage getCpsPackage() { + return (CpsPackage) getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static CpsPackage getPackage() { + return CpsPackage.eINSTANCE; + } + +} //CpsFactoryImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java new file mode 100644 index 00000000..1f143a64 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java @@ -0,0 +1,765 @@ +/** + */ +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.CpsFactory; +import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; +import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; +import hu.bme.mit.inf.dslreasoner.domains.cps.Request; +import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; +import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class CpsPackageImpl extends EPackageImpl implements CpsPackage { + /** + * + * + * @generated + */ + private EClass cyberPhysicalSystemEClass = null; + + /** + * + * + * @generated + */ + private EClass applicationTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass hostTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass requestEClass = null; + + /** + * + * + * @generated + */ + private EClass requirementEClass = null; + + /** + * + * + * @generated + */ + private EClass applicationInstanceEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceRequirementEClass = null; + + /** + * + * + * @generated + */ + private EClass hostInstanceEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#eNS_URI + * @see #init() + * @generated + */ + private CpsPackageImpl() { + super(eNS_URI, CpsFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link CpsPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static CpsPackage init() { + if (isInited) + return (CpsPackage) EPackage.Registry.INSTANCE.getEPackage(CpsPackage.eNS_URI); + + // Obtain or create and register package + Object registeredCpsPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + CpsPackageImpl theCpsPackage = registeredCpsPackage instanceof CpsPackageImpl + ? (CpsPackageImpl) registeredCpsPackage + : new CpsPackageImpl(); + + isInited = true; + + // Create package meta-data objects + theCpsPackage.createPackageContents(); + + // Initialize created meta-data + theCpsPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theCpsPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, theCpsPackage); + return theCpsPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getCyberPhysicalSystem() { + return cyberPhysicalSystemEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCyberPhysicalSystem_Requests() { + return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCyberPhysicalSystem_ApplicationTypes() { + return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCyberPhysicalSystem_HostTypes() { + return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCyberPhysicalSystem_Hosts() { + return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCyberPhysicalSystem_Applications() { + return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getApplicationType() { + return applicationTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getApplicationType_Instances() { + return (EReference) applicationTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getApplicationType_Requirements() { + return (EReference) applicationTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getHostType() { + return hostTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getHostType_DefaultMemory() { + return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getHostType_DefaultHdd() { + return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getHostType_Instances() { + return (EReference) hostTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getHostType_Cost() { + return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRequest() { + return requestEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequest_Requirements() { + return (EReference) requestEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRequirement() { + return requirementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirement_Request() { + return (EReference) requirementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getRequirement_Count() { + return (EAttribute) requirementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirement_Type() { + return (EReference) requirementEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirement_Instances() { + return (EReference) requirementEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getApplicationInstance() { + return applicationInstanceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getApplicationInstance_Requirement() { + return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getApplicationInstance_Type() { + return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getApplicationInstance_AllocatedTo() { + return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getResourceRequirement() { + return resourceRequirementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getResourceRequirement_RequiredMemory() { + return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getResourceRequirement_RequiredHdd() { + return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceRequirement_HostType() { + return (EReference) resourceRequirementEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getHostInstance() { + return hostInstanceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getHostInstance_Type() { + return (EReference) hostInstanceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getHostInstance_AvailableMemory() { + return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getHostInstance_AvailableHdd() { + return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getHostInstance_TotalMemory() { + return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getHostInstance_TotalHdd() { + return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getHostInstance_Applications() { + return (EReference) hostInstanceEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public CpsFactory getCpsFactory() { + return (CpsFactory) getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + cyberPhysicalSystemEClass = createEClass(CYBER_PHYSICAL_SYSTEM); + createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__REQUESTS); + createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES); + createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOST_TYPES); + createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOSTS); + createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATIONS); + + applicationTypeEClass = createEClass(APPLICATION_TYPE); + createEReference(applicationTypeEClass, APPLICATION_TYPE__INSTANCES); + createEReference(applicationTypeEClass, APPLICATION_TYPE__REQUIREMENTS); + + hostTypeEClass = createEClass(HOST_TYPE); + createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_MEMORY); + createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_HDD); + createEReference(hostTypeEClass, HOST_TYPE__INSTANCES); + createEAttribute(hostTypeEClass, HOST_TYPE__COST); + + requestEClass = createEClass(REQUEST); + createEReference(requestEClass, REQUEST__REQUIREMENTS); + + requirementEClass = createEClass(REQUIREMENT); + createEReference(requirementEClass, REQUIREMENT__REQUEST); + createEAttribute(requirementEClass, REQUIREMENT__COUNT); + createEReference(requirementEClass, REQUIREMENT__TYPE); + createEReference(requirementEClass, REQUIREMENT__INSTANCES); + + applicationInstanceEClass = createEClass(APPLICATION_INSTANCE); + createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__REQUIREMENT); + createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__TYPE); + createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__ALLOCATED_TO); + + resourceRequirementEClass = createEClass(RESOURCE_REQUIREMENT); + createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_MEMORY); + createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_HDD); + createEReference(resourceRequirementEClass, RESOURCE_REQUIREMENT__HOST_TYPE); + + hostInstanceEClass = createEClass(HOST_INSTANCE); + createEReference(hostInstanceEClass, HOST_INSTANCE__TYPE); + createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_MEMORY); + createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_HDD); + createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_MEMORY); + createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_HDD); + createEReference(hostInstanceEClass, HOST_INSTANCE__APPLICATIONS); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(cyberPhysicalSystemEClass, CyberPhysicalSystem.class, "CyberPhysicalSystem", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCyberPhysicalSystem_Requests(), this.getRequest(), null, "requests", null, 0, -1, + CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCyberPhysicalSystem_ApplicationTypes(), this.getApplicationType(), null, "applicationTypes", + null, 0, -1, CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCyberPhysicalSystem_HostTypes(), this.getHostType(), null, "hostTypes", null, 0, -1, + CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCyberPhysicalSystem_Hosts(), this.getHostInstance(), null, "hosts", null, 0, -1, + CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getCyberPhysicalSystem_Applications(), this.getApplicationInstance(), null, "applications", null, + 0, -1, CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(applicationTypeEClass, ApplicationType.class, "ApplicationType", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getApplicationType_Instances(), this.getApplicationInstance(), + this.getApplicationInstance_Type(), "instances", null, 0, -1, ApplicationType.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEReference(getApplicationType_Requirements(), this.getResourceRequirement(), null, "requirements", null, 0, + -1, ApplicationType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(hostTypeEClass, HostType.class, "HostType", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getHostType_DefaultMemory(), ecorePackage.getEInt(), "defaultMemory", null, 1, 1, HostType.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getHostType_DefaultHdd(), ecorePackage.getEInt(), "defaultHdd", null, 1, 1, HostType.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getHostType_Instances(), this.getHostInstance(), this.getHostInstance_Type(), "instances", null, + 0, -1, HostType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getHostType_Cost(), ecorePackage.getEInt(), "cost", null, 1, 1, HostType.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(requestEClass, Request.class, "Request", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRequest_Requirements(), this.getRequirement(), this.getRequirement_Request(), "requirements", + null, 0, -1, Request.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(requirementEClass, Requirement.class, "Requirement", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getRequirement_Request(), this.getRequest(), this.getRequest_Requirements(), "request", null, 1, + 1, Requirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getRequirement_Count(), ecorePackage.getEInt(), "count", null, 1, 1, Requirement.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRequirement_Type(), this.getApplicationType(), null, "type", null, 0, 1, Requirement.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRequirement_Instances(), this.getApplicationInstance(), + this.getApplicationInstance_Requirement(), "instances", null, 0, -1, Requirement.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + + initEClass(applicationInstanceEClass, ApplicationInstance.class, "ApplicationInstance", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getApplicationInstance_Requirement(), this.getRequirement(), this.getRequirement_Instances(), + "requirement", null, 0, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getApplicationInstance_Type(), this.getApplicationType(), this.getApplicationType_Instances(), + "type", null, 1, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getApplicationInstance_AllocatedTo(), this.getHostInstance(), + this.getHostInstance_Applications(), "allocatedTo", null, 1, 1, ApplicationInstance.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(resourceRequirementEClass, ResourceRequirement.class, "ResourceRequirement", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getResourceRequirement_RequiredMemory(), ecorePackage.getEInt(), "requiredMemory", null, 1, 1, + ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getResourceRequirement_RequiredHdd(), ecorePackage.getEInt(), "requiredHdd", null, 1, 1, + ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getResourceRequirement_HostType(), this.getHostType(), null, "hostType", null, 1, 1, + ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(hostInstanceEClass, HostInstance.class, "HostInstance", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getHostInstance_Type(), this.getHostType(), this.getHostType_Instances(), "type", null, 1, 1, + HostInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getHostInstance_AvailableMemory(), ecorePackage.getEInt(), "availableMemory", null, 0, 1, + HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEAttribute(getHostInstance_AvailableHdd(), ecorePackage.getEInt(), "availableHdd", null, 0, 1, + HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEAttribute(getHostInstance_TotalMemory(), ecorePackage.getEInt(), "totalMemory", null, 0, 1, + HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEAttribute(getHostInstance_TotalHdd(), ecorePackage.getEInt(), "totalHdd", null, 0, 1, HostInstance.class, + IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getHostInstance_Applications(), this.getApplicationInstance(), + this.getApplicationInstance_AllocatedTo(), "applications", null, 0, -1, HostInstance.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/emf/2002/Ecore + createEcoreAnnotations(); + // org.eclipse.viatra.query.querybasedfeature + createOrgAnnotations(); + } + + /** + * Initializes the annotations for http://www.eclipse.org/emf/2002/Ecore. + * + * + * @generated + */ + protected void createEcoreAnnotations() { + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation(this, source, new String[] { "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" }); + } + + /** + * Initializes the annotations for org.eclipse.viatra.query.querybasedfeature. + * + * + * @generated + */ + protected void createOrgAnnotations() { + String source = "org.eclipse.viatra.query.querybasedfeature"; + addAnnotation(getCyberPhysicalSystem_Hosts(), source, + new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts" }); + addAnnotation(getCyberPhysicalSystem_Applications(), source, + new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications" }); + addAnnotation(getHostInstance_AvailableMemory(), source, + new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory" }); + addAnnotation(getHostInstance_AvailableHdd(), source, + new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd" }); + addAnnotation(getHostInstance_TotalMemory(), source, + new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory" }); + addAnnotation(getHostInstance_TotalHdd(), source, + new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd" }); + } + +} //CpsPackageImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java new file mode 100644 index 00000000..4d254f25 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java @@ -0,0 +1,289 @@ +/** + */ +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.CyberPhysicalSystem; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; +import hu.bme.mit.inf.dslreasoner.domains.cps.Request; + +import java.util.Collection; + +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.EStructuralFeature; +import org.eclipse.emf.ecore.InternalEObject; + +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 'Cyber Physical System'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getRequests Requests}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplicationTypes Application Types}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHostTypes Host Types}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHosts Hosts}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplications Applications}
  • + *
+ * + * @generated + */ +public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implements CyberPhysicalSystem { + /** + * The cached value of the '{@link #getRequests() Requests}' containment reference list. + * + * + * @see #getRequests() + * @generated + * @ordered + */ + protected EList requests; + + /** + * The cached value of the '{@link #getApplicationTypes() Application Types}' containment reference list. + * + * + * @see #getApplicationTypes() + * @generated + * @ordered + */ + protected EList applicationTypes; + + /** + * The cached value of the '{@link #getHostTypes() Host Types}' containment reference list. + * + * + * @see #getHostTypes() + * @generated + * @ordered + */ + protected EList hostTypes; + + /** + * The cached setting delegate for the '{@link #getHosts() Hosts}' reference list. + * + * + * @see #getHosts() + * @generated + * @ordered + */ + protected EStructuralFeature.Internal.SettingDelegate HOSTS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__HOSTS) + .getSettingDelegate(); + + /** + * The cached setting delegate for the '{@link #getApplications() Applications}' reference list. + * + * + * @see #getApplications() + * @generated + * @ordered + */ + protected EStructuralFeature.Internal.SettingDelegate APPLICATIONS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__APPLICATIONS) + .getSettingDelegate(); + + /** + * + * + * @generated + */ + protected CyberPhysicalSystemImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM; + } + + /** + * + * + * @generated + */ + @Override + public EList getRequests() { + if (requests == null) { + requests = new EObjectContainmentEList(Request.class, this, + CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS); + } + return requests; + } + + /** + * + * + * @generated + */ + @Override + public EList getApplicationTypes() { + if (applicationTypes == null) { + applicationTypes = new EObjectContainmentEList(ApplicationType.class, this, + CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES); + } + return applicationTypes; + } + + /** + * + * + * @generated + */ + @Override + public EList getHostTypes() { + if (hostTypes == null) { + hostTypes = new EObjectContainmentEList(HostType.class, this, + CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES); + } + return hostTypes; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public EList getHosts() { + return (EList) HOSTS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public EList getApplications() { + return (EList) APPLICATIONS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: + return ((InternalEList) getRequests()).basicRemove(otherEnd, msgs); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: + return ((InternalEList) getApplicationTypes()).basicRemove(otherEnd, msgs); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: + return ((InternalEList) getHostTypes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: + return getRequests(); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: + return getApplicationTypes(); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: + return getHostTypes(); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS: + return getHosts(); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS: + return getApplications(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: + getRequests().clear(); + getRequests().addAll((Collection) newValue); + return; + case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: + getApplicationTypes().clear(); + getApplicationTypes().addAll((Collection) newValue); + return; + case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: + getHostTypes().clear(); + getHostTypes().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: + getRequests().clear(); + return; + case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: + getApplicationTypes().clear(); + return; + case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: + getHostTypes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: + return requests != null && !requests.isEmpty(); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: + return applicationTypes != null && !applicationTypes.isEmpty(); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: + return hostTypes != null && !hostTypes.isEmpty(); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS: + return HOSTS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS: + return APPLICATIONS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + } + return super.eIsSet(featureID); + } + +} //CyberPhysicalSystemImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java new file mode 100644 index 00000000..bbaca59c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java @@ -0,0 +1,355 @@ +/** + */ +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.CpsPackage; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; + +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.EStructuralFeature; +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 'Host Instance'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getType Type}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableMemory Available Memory}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableHdd Available Hdd}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalMemory Total Memory}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalHdd Total Hdd}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getApplications Applications}
  • + *
+ * + * @generated + */ +public class HostInstanceImpl extends MinimalEObjectImpl.Container implements HostInstance { + /** + * The cached setting delegate for the '{@link #getAvailableMemory() Available Memory}' attribute. + * + * + * @see #getAvailableMemory() + * @generated + * @ordered + */ + protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_MEMORY) + .getSettingDelegate(); + + /** + * The cached setting delegate for the '{@link #getAvailableHdd() Available Hdd}' attribute. + * + * + * @see #getAvailableHdd() + * @generated + * @ordered + */ + protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_HDD) + .getSettingDelegate(); + + /** + * The cached setting delegate for the '{@link #getTotalMemory() Total Memory}' attribute. + * + * + * @see #getTotalMemory() + * @generated + * @ordered + */ + protected EStructuralFeature.Internal.SettingDelegate TOTAL_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_MEMORY) + .getSettingDelegate(); + + /** + * The cached setting delegate for the '{@link #getTotalHdd() Total Hdd}' attribute. + * + * + * @see #getTotalHdd() + * @generated + * @ordered + */ + protected EStructuralFeature.Internal.SettingDelegate TOTAL_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_HDD) + .getSettingDelegate(); + + /** + * The cached value of the '{@link #getApplications() Applications}' reference list. + * + * + * @see #getApplications() + * @generated + * @ordered + */ + protected EList applications; + + /** + * + * + * @generated + */ + protected HostInstanceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.HOST_INSTANCE; + } + + /** + * + * + * @generated + */ + @Override + public HostType getType() { + if (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE) + return null; + return (HostType) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetType(HostType newType, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.HOST_INSTANCE__TYPE, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setType(HostType newType) { + if (newType != eInternalContainer() + || (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE && newType != null)) { + if (EcoreUtil.isAncestor(this, newType)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newType != null) + msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, + msgs); + msgs = basicSetType(newType, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_INSTANCE__TYPE, newType, newType)); + } + + /** + * + * + * @generated + */ + @Override + public int getAvailableMemory() { + return (Integer) AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + } + + /** + * + * + * @generated + */ + @Override + public int getAvailableHdd() { + return (Integer) AVAILABLE_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + } + + /** + * + * + * @generated + */ + @Override + public int getTotalMemory() { + return (Integer) TOTAL_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + } + + /** + * + * + * @generated + */ + @Override + public int getTotalHdd() { + return (Integer) TOTAL_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + } + + /** + * + * + * @generated + */ + @Override + public EList getApplications() { + if (applications == null) { + applications = new EObjectWithInverseResolvingEList(ApplicationInstance.class, this, + CpsPackage.HOST_INSTANCE__APPLICATIONS, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO); + } + return applications; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.HOST_INSTANCE__TYPE: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetType((HostType) otherEnd, msgs); + case CpsPackage.HOST_INSTANCE__APPLICATIONS: + return ((InternalEList) (InternalEList) getApplications()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.HOST_INSTANCE__TYPE: + return basicSetType(null, msgs); + case CpsPackage.HOST_INSTANCE__APPLICATIONS: + return ((InternalEList) getApplications()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case CpsPackage.HOST_INSTANCE__TYPE: + return eInternalContainer().eInverseRemove(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.HOST_INSTANCE__TYPE: + return getType(); + case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY: + return getAvailableMemory(); + case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD: + return getAvailableHdd(); + case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY: + return getTotalMemory(); + case CpsPackage.HOST_INSTANCE__TOTAL_HDD: + return getTotalHdd(); + case CpsPackage.HOST_INSTANCE__APPLICATIONS: + return getApplications(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.HOST_INSTANCE__TYPE: + setType((HostType) newValue); + return; + case CpsPackage.HOST_INSTANCE__APPLICATIONS: + getApplications().clear(); + getApplications().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.HOST_INSTANCE__TYPE: + setType((HostType) null); + return; + case CpsPackage.HOST_INSTANCE__APPLICATIONS: + getApplications().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.HOST_INSTANCE__TYPE: + return getType() != null; + case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY: + return AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD: + return AVAILABLE_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY: + return TOTAL_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + case CpsPackage.HOST_INSTANCE__TOTAL_HDD: + return TOTAL_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + case CpsPackage.HOST_INSTANCE__APPLICATIONS: + return applications != null && !applications.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //HostInstanceImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java new file mode 100644 index 00000000..c3d5b3dc --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java @@ -0,0 +1,356 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.cps.impl; + +import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; + +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.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Host Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getDefaultMemory Default Memory}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getDefaultHdd Default Hdd}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getInstances Instances}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getCost Cost}
  • + *
+ * + * @generated + */ +public class HostTypeImpl extends MinimalEObjectImpl.Container implements HostType { + /** + * The default value of the '{@link #getDefaultMemory() Default Memory}' attribute. + * + * + * @see #getDefaultMemory() + * @generated + * @ordered + */ + protected static final int DEFAULT_MEMORY_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getDefaultMemory() Default Memory}' attribute. + * + * + * @see #getDefaultMemory() + * @generated + * @ordered + */ + protected int defaultMemory = DEFAULT_MEMORY_EDEFAULT; + + /** + * The default value of the '{@link #getDefaultHdd() Default Hdd}' attribute. + * + * + * @see #getDefaultHdd() + * @generated + * @ordered + */ + protected static final int DEFAULT_HDD_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getDefaultHdd() Default Hdd}' attribute. + * + * + * @see #getDefaultHdd() + * @generated + * @ordered + */ + protected int defaultHdd = DEFAULT_HDD_EDEFAULT; + + /** + * The cached value of the '{@link #getInstances() Instances}' containment reference list. + * + * + * @see #getInstances() + * @generated + * @ordered + */ + protected EList instances; + + /** + * The default value of the '{@link #getCost() Cost}' attribute. + * + * + * @see #getCost() + * @generated + * @ordered + */ + protected static final int COST_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getCost() Cost}' attribute. + * + * + * @see #getCost() + * @generated + * @ordered + */ + protected int cost = COST_EDEFAULT; + + /** + * + * + * @generated + */ + protected HostTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.HOST_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public int getDefaultMemory() { + return defaultMemory; + } + + /** + * + * + * @generated + */ + @Override + public void setDefaultMemory(int newDefaultMemory) { + int oldDefaultMemory = defaultMemory; + defaultMemory = newDefaultMemory; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__DEFAULT_MEMORY, + oldDefaultMemory, defaultMemory)); + } + + /** + * + * + * @generated + */ + @Override + public int getDefaultHdd() { + return defaultHdd; + } + + /** + * + * + * @generated + */ + @Override + public void setDefaultHdd(int newDefaultHdd) { + int oldDefaultHdd = defaultHdd; + defaultHdd = newDefaultHdd; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__DEFAULT_HDD, oldDefaultHdd, + defaultHdd)); + } + + /** + * + * + * @generated + */ + @Override + public EList getInstances() { + if (instances == null) { + instances = new EObjectContainmentWithInverseEList(HostInstance.class, this, + CpsPackage.HOST_TYPE__INSTANCES, CpsPackage.HOST_INSTANCE__TYPE); + } + return instances; + } + + /** + * + * + * @generated + */ + @Override + public int getCost() { + return cost; + } + + /** + * + * + * @generated + */ + @Override + public void setCost(int newCost) { + int oldCost = cost; + cost = newCost; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__COST, oldCost, cost)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.HOST_TYPE__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.HOST_TYPE__INSTANCES: + return ((InternalEList) getInstances()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: + return getDefaultMemory(); + case CpsPackage.HOST_TYPE__DEFAULT_HDD: + return getDefaultHdd(); + case CpsPackage.HOST_TYPE__INSTANCES: + return getInstances(); + case CpsPackage.HOST_TYPE__COST: + return getCost(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: + setDefaultMemory((Integer) newValue); + return; + case CpsPackage.HOST_TYPE__DEFAULT_HDD: + setDefaultHdd((Integer) newValue); + return; + case CpsPackage.HOST_TYPE__INSTANCES: + getInstances().clear(); + getInstances().addAll((Collection) newValue); + return; + case CpsPackage.HOST_TYPE__COST: + setCost((Integer) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: + setDefaultMemory(DEFAULT_MEMORY_EDEFAULT); + return; + case CpsPackage.HOST_TYPE__DEFAULT_HDD: + setDefaultHdd(DEFAULT_HDD_EDEFAULT); + return; + case CpsPackage.HOST_TYPE__INSTANCES: + getInstances().clear(); + return; + case CpsPackage.HOST_TYPE__COST: + setCost(COST_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: + return defaultMemory != DEFAULT_MEMORY_EDEFAULT; + case CpsPackage.HOST_TYPE__DEFAULT_HDD: + return defaultHdd != DEFAULT_HDD_EDEFAULT; + case CpsPackage.HOST_TYPE__INSTANCES: + return instances != null && !instances.isEmpty(); + case CpsPackage.HOST_TYPE__COST: + return cost != COST_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (defaultMemory: "); + result.append(defaultMemory); + result.append(", defaultHdd: "); + result.append(defaultHdd); + result.append(", cost: "); + result.append(cost); + result.append(')'); + return result.toString(); + } + +} //HostTypeImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java new file mode 100644 index 00000000..72b4c732 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java @@ -0,0 +1,169 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.cps.impl; + +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.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.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Request'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl#getRequirements Requirements}
  • + *
+ * + * @generated + */ +public class RequestImpl extends MinimalEObjectImpl.Container implements Request { + /** + * The cached value of the '{@link #getRequirements() Requirements}' containment reference list. + * + * + * @see #getRequirements() + * @generated + * @ordered + */ + protected EList requirements; + + /** + * + * + * @generated + */ + protected RequestImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.REQUEST; + } + + /** + * + * + * @generated + */ + @Override + public EList getRequirements() { + if (requirements == null) { + requirements = new EObjectContainmentWithInverseEList(Requirement.class, this, + CpsPackage.REQUEST__REQUIREMENTS, CpsPackage.REQUIREMENT__REQUEST); + } + return requirements; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.REQUEST__REQUIREMENTS: + return ((InternalEList) (InternalEList) getRequirements()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case CpsPackage.REQUEST__REQUIREMENTS: + return ((InternalEList) getRequirements()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.REQUEST__REQUIREMENTS: + return getRequirements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.REQUEST__REQUIREMENTS: + getRequirements().clear(); + getRequirements().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.REQUEST__REQUIREMENTS: + getRequirements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.REQUEST__REQUIREMENTS: + return requirements != null && !requirements.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //RequestImpl 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: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getRequest Request}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getCount Count}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getType Type}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getInstances Instances}
  • + *
+ * + * @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 diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java new file mode 100644 index 00000000..f4deb575 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java @@ -0,0 +1,291 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.cps.impl; + +import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; +import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; +import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; + +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 'Resource Requirement'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getRequiredMemory Required Memory}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getRequiredHdd Required Hdd}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getHostType Host Type}
  • + *
+ * + * @generated + */ +public class ResourceRequirementImpl extends MinimalEObjectImpl.Container implements ResourceRequirement { + /** + * The default value of the '{@link #getRequiredMemory() Required Memory}' attribute. + * + * + * @see #getRequiredMemory() + * @generated + * @ordered + */ + protected static final int REQUIRED_MEMORY_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getRequiredMemory() Required Memory}' attribute. + * + * + * @see #getRequiredMemory() + * @generated + * @ordered + */ + protected int requiredMemory = REQUIRED_MEMORY_EDEFAULT; + + /** + * The default value of the '{@link #getRequiredHdd() Required Hdd}' attribute. + * + * + * @see #getRequiredHdd() + * @generated + * @ordered + */ + protected static final int REQUIRED_HDD_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getRequiredHdd() Required Hdd}' attribute. + * + * + * @see #getRequiredHdd() + * @generated + * @ordered + */ + protected int requiredHdd = REQUIRED_HDD_EDEFAULT; + + /** + * The cached value of the '{@link #getHostType() Host Type}' reference. + * + * + * @see #getHostType() + * @generated + * @ordered + */ + protected HostType hostType; + + /** + * + * + * @generated + */ + protected ResourceRequirementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return CpsPackage.Literals.RESOURCE_REQUIREMENT; + } + + /** + * + * + * @generated + */ + @Override + public int getRequiredMemory() { + return requiredMemory; + } + + /** + * + * + * @generated + */ + @Override + public void setRequiredMemory(int newRequiredMemory) { + int oldRequiredMemory = requiredMemory; + requiredMemory = newRequiredMemory; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY, + oldRequiredMemory, requiredMemory)); + } + + /** + * + * + * @generated + */ + @Override + public int getRequiredHdd() { + return requiredHdd; + } + + /** + * + * + * @generated + */ + @Override + public void setRequiredHdd(int newRequiredHdd) { + int oldRequiredHdd = requiredHdd; + requiredHdd = newRequiredHdd; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD, + oldRequiredHdd, requiredHdd)); + } + + /** + * + * + * @generated + */ + @Override + public HostType getHostType() { + if (hostType != null && hostType.eIsProxy()) { + InternalEObject oldHostType = (InternalEObject) hostType; + hostType = (HostType) eResolveProxy(oldHostType); + if (hostType != oldHostType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE, oldHostType, hostType)); + } + } + return hostType; + } + + /** + * + * + * @generated + */ + public HostType basicGetHostType() { + return hostType; + } + + /** + * + * + * @generated + */ + @Override + public void setHostType(HostType newHostType) { + HostType oldHostType = hostType; + hostType = newHostType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE, + oldHostType, hostType)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: + return getRequiredMemory(); + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: + return getRequiredHdd(); + case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: + if (resolve) + return getHostType(); + return basicGetHostType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: + setRequiredMemory((Integer) newValue); + return; + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: + setRequiredHdd((Integer) newValue); + return; + case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: + setHostType((HostType) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: + setRequiredMemory(REQUIRED_MEMORY_EDEFAULT); + return; + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: + setRequiredHdd(REQUIRED_HDD_EDEFAULT); + return; + case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: + setHostType((HostType) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: + return requiredMemory != REQUIRED_MEMORY_EDEFAULT; + case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: + return requiredHdd != REQUIRED_HDD_EDEFAULT; + case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: + return hostType != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (requiredMemory: "); + result.append(requiredMemory); + result.append(", requiredHdd: "); + result.append(requiredHdd); + result.append(')'); + return result.toString(); + } + +} //ResourceRequirementImpl -- cgit v1.2.3-70-g09d2