Skip to content

Commit

Permalink
knowledge change trigger refers to a single knowledge path
Browse files Browse the repository at this point in the history
  • Loading branch information
keznikl committed Oct 24, 2013
1 parent 28cf222 commit b8ae7bf
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 39 deletions.
2 changes: 1 addition & 1 deletion jdeeco-core/model/RuntimeModel.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="KnowledgeChangeTrigger" eSuperTypes="#//Trigger">
<eStructuralFeatures xsi:type="ecore:EReference" name="knowledgePath" upperBound="-1"
<eStructuralFeatures xsi:type="ecore:EReference" name="knowledgePath" lowerBound="1"
eType="#//KnowledgePath" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="KnowledgePath">
Expand Down
2 changes: 1 addition & 1 deletion jdeeco-core/model/RuntimeModel.ecorediag
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_n6RFYTyaEeOBILfoZuXX_w" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/>
<element xmi:type="ecore:EClass" href="RuntimeModel.ecore#//Schedule"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_n6RFYjyaEeOBILfoZuXX_w" x="48" y="324"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_n6RFYjyaEeOBILfoZuXX_w" x="12" y="336"/>
</children>
<children xmi:type="notation:Node" xmi:id="_n6XzGTyaEeOBILfoZuXX_w" type="1001">
<children xmi:type="notation:Node" xmi:id="_n6XzHDyaEeOBILfoZuXX_w" type="4001"/>
Expand Down
20 changes: 9 additions & 11 deletions jdeeco-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,14 @@
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.9.0-v20130528-0742</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>2.9.0-v20130528-0742</version>
</dependency>


<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.9.0-v20130528-0742</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>2.9.0-v20130528-0742</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*/
package cz.cuni.mff.d3s.deeco.model.runtime.api;

import org.eclipse.emf.common.util.EList;

/**
* <!-- begin-user-doc -->
Expand All @@ -22,19 +21,29 @@
*/
public interface KnowledgeChangeTrigger extends Trigger {
/**
* Returns the value of the '<em><b>Knowledge Path</b></em>' containment reference list.
* The list contents are of type {@link cz.cuni.mff.d3s.deeco.model.runtime.api.KnowledgePath}.
* Returns the value of the '<em><b>Knowledge Path</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Knowledge Path</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Knowledge Path</em>' containment reference list.
* @return the value of the '<em>Knowledge Path</em>' containment reference.
* @see #setKnowledgePath(KnowledgePath)
* @see cz.cuni.mff.d3s.deeco.model.runtime.meta.runtimePackage#getKnowledgeChangeTrigger_KnowledgePath()
* @model containment="true"
* @model containment="true" required="true"
* @generated
*/
EList<KnowledgePath> getKnowledgePath();
KnowledgePath getKnowledgePath();

/**
* Sets the value of the '{@link cz.cuni.mff.d3s.deeco.model.runtime.api.KnowledgeChangeTrigger#getKnowledgePath <em>Knowledge Path</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Knowledge Path</em>' containment reference.
* @see #getKnowledgePath()
* @generated
*/
void setKnowledgePath(KnowledgePath value);

} // KnowledgeChangeTrigger
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@

import cz.cuni.mff.d3s.deeco.model.runtime.meta.runtimePackage;

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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
* <!-- begin-user-doc -->
Expand All @@ -34,14 +32,14 @@
*/
public class KnowledgeChangeTriggerImpl extends TriggerImpl implements KnowledgeChangeTrigger {
/**
* The cached value of the '{@link #getKnowledgePath() <em>Knowledge Path</em>}' containment reference list.
* The cached value of the '{@link #getKnowledgePath() <em>Knowledge Path</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getKnowledgePath()
* @generated
* @ordered
*/
protected EList<KnowledgePath> knowledgePath;
protected KnowledgePath knowledgePath;

/**
* <!-- begin-user-doc -->
Expand All @@ -67,13 +65,44 @@ protected EClass eStaticClass() {
* <!-- end-user-doc -->
* @generated
*/
public EList<KnowledgePath> getKnowledgePath() {
if (knowledgePath == null) {
knowledgePath = new EObjectContainmentEList<KnowledgePath>(KnowledgePath.class, this, runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH);
}
public KnowledgePath getKnowledgePath() {
return knowledgePath;
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetKnowledgePath(KnowledgePath newKnowledgePath, NotificationChain msgs) {
KnowledgePath oldKnowledgePath = knowledgePath;
knowledgePath = newKnowledgePath;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH, oldKnowledgePath, newKnowledgePath);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setKnowledgePath(KnowledgePath newKnowledgePath) {
if (newKnowledgePath != knowledgePath) {
NotificationChain msgs = null;
if (knowledgePath != null)
msgs = ((InternalEObject)knowledgePath).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH, null, msgs);
if (newKnowledgePath != null)
msgs = ((InternalEObject)newKnowledgePath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH, null, msgs);
msgs = basicSetKnowledgePath(newKnowledgePath, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH, newKnowledgePath, newKnowledgePath));
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand All @@ -83,7 +112,7 @@ public EList<KnowledgePath> getKnowledgePath() {
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH:
return ((InternalEList<?>)getKnowledgePath()).basicRemove(otherEnd, msgs);
return basicSetKnowledgePath(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
Expand Down Expand Up @@ -112,8 +141,7 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) {
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH:
getKnowledgePath().clear();
getKnowledgePath().addAll((Collection<? extends KnowledgePath>)newValue);
setKnowledgePath((KnowledgePath)newValue);
return;
}
super.eSet(featureID, newValue);
Expand All @@ -128,7 +156,7 @@ public void eSet(int featureID, Object newValue) {
public void eUnset(int featureID) {
switch (featureID) {
case runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH:
getKnowledgePath().clear();
setKnowledgePath((KnowledgePath)null);
return;
}
super.eUnset(featureID);
Expand All @@ -143,7 +171,7 @@ public void eUnset(int featureID) {
public boolean eIsSet(int featureID) {
switch (featureID) {
case runtimePackage.KNOWLEDGE_CHANGE_TRIGGER__KNOWLEDGE_PATH:
return knowledgePath != null && !knowledgePath.isEmpty();
return knowledgePath != null;
}
return super.eIsSet(featureID);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public void initializePackageContents() {
initEClass(triggerEClass, Trigger.class, "Trigger", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

initEClass(knowledgeChangeTriggerEClass, KnowledgeChangeTrigger.class, "KnowledgeChangeTrigger", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getKnowledgeChangeTrigger_KnowledgePath(), this.getKnowledgePath(), null, "knowledgePath", null, 0, -1, KnowledgeChangeTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getKnowledgeChangeTrigger_KnowledgePath(), this.getKnowledgePath(), null, "knowledgePath", null, 1, 1, KnowledgeChangeTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

initEClass(knowledgePathEClass, KnowledgePath.class, "KnowledgePath", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getKnowledgePath_Nodes(), this.getPathNode(), null, "nodes", null, 1, -1, KnowledgePath.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public interface runtimePackage extends EPackage {
int KNOWLEDGE_CHANGE_TRIGGER = 2;

/**
* The feature id for the '<em><b>Knowledge Path</b></em>' containment reference list.
* The feature id for the '<em><b>Knowledge Path</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
Expand Down Expand Up @@ -371,10 +371,10 @@ public interface runtimePackage extends EPackage {
EClass getKnowledgeChangeTrigger();

/**
* Returns the meta object for the containment reference list '{@link cz.cuni.mff.d3s.deeco.model.runtime.api.KnowledgeChangeTrigger#getKnowledgePath <em>Knowledge Path</em>}'.
* Returns the meta object for the containment reference '{@link cz.cuni.mff.d3s.deeco.model.runtime.api.KnowledgeChangeTrigger#getKnowledgePath <em>Knowledge Path</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Knowledge Path</em>'.
* @return the meta object for the containment reference '<em>Knowledge Path</em>'.
* @see cz.cuni.mff.d3s.deeco.model.runtime.api.KnowledgeChangeTrigger#getKnowledgePath()
* @see #getKnowledgeChangeTrigger()
* @generated
Expand Down Expand Up @@ -535,7 +535,7 @@ interface Literals {
EClass KNOWLEDGE_CHANGE_TRIGGER = eINSTANCE.getKnowledgeChangeTrigger();

/**
* The meta object literal for the '<em><b>Knowledge Path</b></em>' containment reference list feature.
* The meta object literal for the '<em><b>Knowledge Path</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
Expand Down

0 comments on commit b8ae7bf

Please sign in to comment.