-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added model and syntactic support for sum aggregation function (can b…
…e easily extended to support other aggregation functions as well).
- Loading branch information
1 parent
f0d2dfc
commit ee24f4c
Showing
7 changed files
with
679 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
207 changes: 207 additions & 0 deletions
207
jdeeco-edl-model/src/cz/cuni/mff/d3s/jdeeco/edl/model/edl/impl/AggregationImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
/** | ||
*/ | ||
package cz.cuni.mff.d3s.jdeeco.edl.model.edl.impl; | ||
|
||
import cz.cuni.mff.d3s.jdeeco.edl.model.edl.Aggregation; | ||
import cz.cuni.mff.d3s.jdeeco.edl.model.edl.EdlPackage; | ||
import cz.cuni.mff.d3s.jdeeco.edl.model.edl.QualifiedName; | ||
import cz.cuni.mff.d3s.jdeeco.edl.model.edl.QueryVisitor; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
|
||
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; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* An implementation of the model object '<em><b>Aggregation</b></em>'. | ||
* <!-- end-user-doc --> | ||
* <p> | ||
* The following features are implemented: | ||
* <ul> | ||
* <li>{@link cz.cuni.mff.d3s.jdeeco.edl.model.edl.impl.AggregationImpl#getCollection <em>Collection</em>}</li> | ||
* </ul> | ||
* </p> | ||
* | ||
* @generated | ||
*/ | ||
public abstract class AggregationImpl extends MinimalEObjectImpl.Container implements Aggregation { | ||
/** | ||
* The cached value of the '{@link #getCollection() <em>Collection</em>}' containment reference. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see #getCollection() | ||
* @generated | ||
* @ordered | ||
*/ | ||
protected QualifiedName collection; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
protected AggregationImpl() { | ||
super(); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
protected EClass eStaticClass() { | ||
return EdlPackage.Literals.AGGREGATION; | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public QualifiedName getCollection() { | ||
return collection; | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public NotificationChain basicSetCollection(QualifiedName newCollection, NotificationChain msgs) { | ||
QualifiedName oldCollection = collection; | ||
collection = newCollection; | ||
if (eNotificationRequired()) { | ||
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EdlPackage.AGGREGATION__COLLECTION, oldCollection, newCollection); | ||
if (msgs == null) msgs = notification; else msgs.add(notification); | ||
} | ||
return msgs; | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public void setCollection(QualifiedName newCollection) { | ||
if (newCollection != collection) { | ||
NotificationChain msgs = null; | ||
if (collection != null) | ||
msgs = ((InternalEObject)collection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EdlPackage.AGGREGATION__COLLECTION, null, msgs); | ||
if (newCollection != null) | ||
msgs = ((InternalEObject)newCollection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EdlPackage.AGGREGATION__COLLECTION, null, msgs); | ||
msgs = basicSetCollection(newCollection, msgs); | ||
if (msgs != null) msgs.dispatch(); | ||
} | ||
else if (eNotificationRequired()) | ||
eNotify(new ENotificationImpl(this, Notification.SET, EdlPackage.AGGREGATION__COLLECTION, newCollection, newCollection)); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public <T> T accept(QueryVisitor<T> visitor) { | ||
// TODO: implement this method | ||
// Ensure that you remove @generated or mark it @generated NOT | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
switch (featureID) { | ||
case EdlPackage.AGGREGATION__COLLECTION: | ||
return basicSetCollection(null, msgs); | ||
} | ||
return super.eInverseRemove(otherEnd, featureID, msgs); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
switch (featureID) { | ||
case EdlPackage.AGGREGATION__COLLECTION: | ||
return getCollection(); | ||
} | ||
return super.eGet(featureID, resolve, coreType); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public void eSet(int featureID, Object newValue) { | ||
switch (featureID) { | ||
case EdlPackage.AGGREGATION__COLLECTION: | ||
setCollection((QualifiedName)newValue); | ||
return; | ||
} | ||
super.eSet(featureID, newValue); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public void eUnset(int featureID) { | ||
switch (featureID) { | ||
case EdlPackage.AGGREGATION__COLLECTION: | ||
setCollection((QualifiedName)null); | ||
return; | ||
} | ||
super.eUnset(featureID); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public boolean eIsSet(int featureID) { | ||
switch (featureID) { | ||
case EdlPackage.AGGREGATION__COLLECTION: | ||
return collection != null; | ||
} | ||
return super.eIsSet(featureID); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
@SuppressWarnings({"rawtypes", "unchecked" }) | ||
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { | ||
switch (operationID) { | ||
case EdlPackage.AGGREGATION___ACCEPT__QUERYVISITOR: | ||
return accept((QueryVisitor)arguments.get(0)); | ||
} | ||
return super.eInvoke(operationID, arguments); | ||
} | ||
|
||
} //AggregationImpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.