Commit 305a1109 authored by Simon Barner's avatar Simon Barner
Browse files

- Fix return type of getAllocationEntries()

- Add getAllocationEntries(? extends AllocationEntry)
parent 9c467593
......@@ -25,9 +25,25 @@
<details key="body" value="return AllocationTableStaticImpl.getAllocationEntries(this);"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//OneToOneAllocationEntry"/>
<eTypeArguments eClassifier="#//AllocationEntry"/>
</eGenericType>
</eOperations>
<eOperations name="getAllocationEntries">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Returns all contained {@link org.fortiss.af3.allocation.model.AllocationEntry}s that are of the given {@code type}."/>
<details key="body" value="return AllocationTableStaticImpl.getAllocationEntries(this, type);"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//AllocationEntry"/>
</eGenericType>
<eParameters name="type" lowerBound="1">
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaClass">
<eTypeArguments>
<eUpperBound eClassifier="#//AllocationEntry"/>
</eTypeArguments>
</eGenericType>
</eParameters>
</eOperations>
<eOperations name="getOneToOneAllocationEntries">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Returns all allocation entries specializing {@link org.fortiss.af3.allocation.model.OneToOneAllocationEntry}."/>
......
......@@ -17,6 +17,9 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//AllocationTable/sourceView"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//AllocationTable/targetView"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getAllocationEntries.1">
<genParameters ecoreParameter="allocation.ecore#//AllocationTable/getAllocationEntries.1/type"/>
</genOperations>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getOneToOneAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getOneToManyAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getManyToOneAllocationEntries"/>
......
......@@ -17,6 +17,7 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.allocation.model.impl;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.generalizeList;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import java.util.Set;
......@@ -37,10 +38,9 @@ import org.fortiss.tooling.base.model.element.IModelElement;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 13B0907F44070E6A4C9311E5F87203B8
* @ConQAT.Rating YELLOW Hash: 063A2E1979F7926AF0E8D9B218CC89CD
*/
public class AllocationTableStaticImpl {
/**
* Returns the {@link AllocationEntry}s contained by the given {@link AllocationTable}.
*
......@@ -55,6 +55,25 @@ public class AllocationTableStaticImpl {
return pickInstanceOf(AllocationEntry.class, allocationTable.getContainedElements());
}
/**
* Returns the {@link AllocationEntry}s contained by the given {@link AllocationTable} that are
* of the given {@code type}.
*
* @param allocationTable
* {@link AllocationTable} for which to the return the contained
* {@link AllocationEntry}s.
* @param type
* {@link AllocationEntry} type to be returned.
*
* @return {@link AllocationEntry}s contained by the given {@link AllocationTable}.
*/
public static EList<AllocationEntry> getAllocationEntries(AllocationTable allocationTable,
Class<? extends AllocationEntry> type) {
return generalizeList(AllocationEntry.class,
pickInstanceOf(type, allocationTable.getContainedElements()));
}
/**
* Returns the {@link OneToOneAllocationEntry}s contained by the given {@link AllocationTable}.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment