Commit 7895bfbf authored by Simon Barner's avatar Simon Barner
Browse files

- Improve nomenclature and rename:

 o Allocation -> AllocationTable
 o Allocation.source/target -> Allocation.source/targetView
 o AllocationTable -> AllocationTableCollection
 o AllocationEntry.source/target -> AllocationEntiry.source/targetElement
- AllocationTable: add eOperations
 o getSourceElement(EList<IModelElement> targetElements)
 o getTargetElement(EList<IModelElement> sourceElements)
- AllocationTableStaticImpl
 o Add missing implementations
refs 2950
parent de46212d
......@@ -9,8 +9,8 @@
-->
<plugin>
<extension point="org.fortiss.tooling.kernel.ui.modelElementHandler">
<modelElementHandler handler="org.fortiss.af3.allocation.ui.handler.AllocationTableHandler">
<modelElementClass modelElementClass="org.fortiss.af3.allocation.model.AllocationTable"/>
<modelElementHandler handler="org.fortiss.af3.allocation.ui.handler.AllocationTableCollectionHandler">
<modelElementClass modelElementClass="org.fortiss.af3.allocation.model.AllocationTableCollection"/>
</modelElementHandler>
</extension>
......
......@@ -47,8 +47,8 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.fortiss.af3.allocation.model.Allocation;
import org.fortiss.af3.allocation.model.AllocationEntry;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.allocation.model.ManyToOneAllocationEntry;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.model.element.IModelElement;
......@@ -58,33 +58,34 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement;
import org.fortiss.tooling.kernel.utils.KernelModelElementUtils;
/**
* Generic {@link Allocation} editor.
* Generic {@link AllocationTable} editor.
*
* @author barner
* @author zverlov
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBase<T> {
public abstract class AllocationTableEditor<T extends AllocationTable> extends GEFEditorBase<T> {
/** {@link AllocationEntry} type to be edited in this {@link AllocationEditor}. */
/** {@link AllocationEntry} type to be edited in this {@link AllocationTableEditor}. */
private Class<? extends AllocationEntry> allocationEntryType;
/** Type of source models used to edit the given {@link Allocation}. */
/** Type of source models used to edit the given {@link AllocationTable}. */
private Class<? extends IProjectRootElement> sourceModelType;
/** Type of target models used to edit the given {@link Allocation}. */
/** Type of target models used to edit the given {@link AllocationTable}. */
private Class<? extends IProjectRootElement> targetModelType;
/**
* Type of source model entities used to create {@link AllocationEntry}s for the given
* {@link Allocation}.
* {@link AllocationTable}.
*/
private Class<? extends IModelElement> sourceEntityType;
/**
* Type of target model entities used to create {@link AllocationEntry}s for the given
* {@link Allocation}.
* {@link AllocationTable}.
*/
private Class<? extends IModelElement> targetEntityType;
......@@ -95,12 +96,12 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
private EList<? extends IModelElement> targetModelElements;
/** The GUI element. */
private AllocationEditorGUI gui;
private AllocationTableEditorGUI gui;
private List<AllocationEntry> allocationEntries;
/** Constructor. */
protected AllocationEditor(Class<? extends AllocationEntry> allocationEntryType,
protected AllocationTableEditor(Class<? extends AllocationEntry> allocationEntryType,
Class<? extends IProjectRootElement> sourceModelType,
Class<? extends IProjectRootElement> targetModelType,
Class<? extends IModelElement> sourceEntityType,
......@@ -133,13 +134,12 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
int allocationEntryIndex = getManyToOneAllocationEntryIndex(target);
if(allocationEntryIndex != -1) {
for(IModelElement e : editedObject.getManyToOneAllocationEntries()
.get(allocationEntryIndex).getSources()) {
.get(allocationEntryIndex).getSourceElements()) {
if(e.equals(source)) {
return true;
}
}
}
}
return false;
}
......@@ -159,8 +159,8 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
ManyToOneAllocationEntry allocationEntry =
(ManyToOneAllocationEntry)org.eclipse.emf.ecore.util.EcoreUtil
.create(eClassForClass);
allocationEntry.setTarget(target);
allocationEntry.getSources().add(source);
allocationEntry.setTargetElement(target);
allocationEntry.getSourceElements().add(source);
runAsCommand(editedObject, new Runnable() {
@Override
public void run() {
......@@ -172,7 +172,7 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
ManyToOneAllocationEntry editedEntry =
editedObject.getManyToOneAllocationEntries().get(
getManyToOneAllocationEntryIndex(target));
editedEntry.getSources().add(source);
editedEntry.getSourceElements().add(source);
// TODO: check whether that works (probably not :P)
runAsCommand(editedObject, new Runnable() {
@Override
......@@ -189,7 +189,8 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
private int getManyToOneAllocationEntryIndex(IModelElement target) {
for(int i = 0; i < editedObject.getManyToOneAllocationEntries().size(); i++) {
if(editedObject.getManyToOneAllocationEntries().get(i).getTarget().equals(target)) {
if(editedObject.getManyToOneAllocationEntries().get(i).getTargetElement()
.equals(target)) {
return i;
}
}
......@@ -203,7 +204,7 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
List<IProjectRootElement> sourceModels = getModels(sourceModelType);
List<IProjectRootElement> targetModels = getModels(targetModelType);
gui = new AllocationEditorGUI(parent, SWT.NONE);
gui = new AllocationTableEditorGUI(parent, SWT.NONE);
System.out.println(editedObject.getName());
gui.getComboViewerDst().setContentProvider(new ArrayContentProvider());
......@@ -216,19 +217,18 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
gui.getComboViewerSrc().addSelectionChangedListener(new ComboSelectionAdapter(true));
gui.getComboViewerSrc().setInput(sourceModels);
loadComboBoxes();
}
/** Loads the Sources and the Target into the ComboBoxes from the model, if not null. */
/** Loads the Sources and the Target view into the ComboBoxes from the model, if not null. */
private void loadComboBoxes() {
if(editedObject.getSource() != null) {
ISelection selectionSource = new StructuredSelection(editedObject.getSource());
if(editedObject.getSourceView() != null) {
ISelection selectionSource = new StructuredSelection(editedObject.getSourceView());
gui.getComboViewerSrc().setSelection(selectionSource);
}
if(editedObject.getTarget() != null) {
ISelection selectionTarget = new StructuredSelection(editedObject.getTarget());
if(editedObject.getTargetView() != null) {
ISelection selectionTarget = new StructuredSelection(editedObject.getTargetView());
gui.getComboViewerDst().setSelection(selectionTarget);
}
}
......@@ -239,12 +239,12 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
IStructuredSelection selection =
(IStructuredSelection)gui.getComboViewerSrc().getSelection();
IHierarchicElement source = (IHierarchicElement)selection.getFirstElement();
IHierarchicElement sourceView = (IHierarchicElement)selection.getFirstElement();
org.fortiss.tooling.kernel.utils.KernelModelElementUtils.runAsCommand(editedObject,
new Runnable() {
@Override
public void run() {
editedObject.setSource(source);
editedObject.setSourceView(sourceView);
}
});
}
......@@ -252,18 +252,18 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
if(!gui.getComboViewerDst().getSelection().isEmpty()) {
IStructuredSelection selection =
(IStructuredSelection)gui.getComboViewerDst().getSelection();
IHierarchicElement target = (IHierarchicElement)selection.getFirstElement();
IHierarchicElement targetView = (IHierarchicElement)selection.getFirstElement();
org.fortiss.tooling.kernel.utils.KernelModelElementUtils.runAsCommand(editedObject,
new Runnable() {
@Override
public void run() {
editedObject.setTarget(target);
editedObject.setTargetView(targetView);
}
});
}
}
/** Creates the TableViewer and adss the first (source) column to it. */
/** Creates the TableViewer and adds the first (source) column to it. */
private void createNewTable() {
// dispose old table
for(TableColumn column : gui.getTableViewer().getTable().getColumns()) {
......@@ -355,16 +355,13 @@ public abstract class AllocationEditor<T extends Allocation> extends GEFEditorBa
} else {
System.out.println("dislocation: " + source.toString() + "->" + target.toString());
}
}
/** {@inheritDoc} */
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// TODO Auto-generated method stub
}
}
private class ComboViewerSetLabelProvider extends LabelProvider {
......
......@@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Table;
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class AllocationEditorGUI extends Composite {
public class AllocationTableEditorGUI extends Composite {
private Table table;
private TableViewer tableViewer;
......@@ -42,7 +42,7 @@ public class AllocationEditorGUI extends Composite {
private ComboViewer comboViewerDst;
/** Constructor. */
public AllocationEditorGUI(Composite parent, int style) {
public AllocationTableEditorGUI(Composite parent, int style) {
super(parent, style);
setLayout(new GridLayout(2, false));
......
......@@ -20,23 +20,24 @@ package org.fortiss.af3.allocation.ui.handler;
import static org.fortiss.af3.allocation.ui.AF3AllocationUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.allocation.model.AllocationTableCollection;
import org.fortiss.tooling.base.ui.extension.base.HierarchicElementHandlerBase;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
/**
* {@link IModelElementHandler} for {@link AllocationTable}.
* {@link IModelElementHandler} for {@link AllocationTableCollection}.
*
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 5F30BF572620C88340A27E2CDC29D466
*/
public class AllocationTableHandler extends HierarchicElementHandlerBase<AllocationTable> {
public class AllocationTableCollectionHandler extends
HierarchicElementHandlerBase<AllocationTableCollection> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/allocationtable.png");
return getImageDescriptor("icons/allocationtablecollection.png");
}
}
......@@ -17,7 +17,6 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.allocation.ui.prototypes;
import org.fortiss.af3.allocation.model.Allocation;
import org.fortiss.af3.allocation.utils.AllocationModelElementFactory;
import org.fortiss.tooling.kernel.extension.IPrototypeProvider;
import org.fortiss.tooling.kernel.extension.base.PrototypeProviderBase;
......@@ -41,9 +40,10 @@ public final class PrototypeProvider extends PrototypeProviderBase {
setupAllocationPrototypes();
}
/** Defines prototypes for {@link Allocation}s. */
/** Defines prototypes for AF3 allocations. */
private void setupAllocationPrototypes() {
registerPrimaryPrototype("AllocationTable",
AllocationModelElementFactory.createAllocationTable("AllocationTable"), CATEGORY);
registerPrimaryPrototype("AllocationTableCollection",
AllocationModelElementFactory
.createAllocationTableCollection("AllocationTableCollection"), CATEGORY);
}
}
......@@ -15,8 +15,5 @@ Export-Package: org.fortiss.af3.allocation,
org.fortiss.af3.allocation.compose,
org.fortiss.af3.allocation.model,
org.fortiss.af3.allocation.model.impl,
org.fortiss.af3.allocation.model.sampleinst,
org.fortiss.af3.allocation.model.sampleinst.impl,
org.fortiss.af3.allocation.model.sampleinst.util,
org.fortiss.af3.allocation.model.util,
org.fortiss.af3.allocation.utils
......@@ -10,40 +10,46 @@
<foreignModel>allocation.ecore</foreignModel>
<genPackages prefix="AF3Allocation" basePackage="org.fortiss.af3.allocation" disposableProviderFactory="true"
ecorePackage="allocation.ecore#/">
<genClasses ecoreClass="allocation.ecore#//AllocationTable">
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getAllocations"/>
<genClasses ecoreClass="allocation.ecore#//AllocationTableCollection">
<genOperations ecoreOperation="allocation.ecore#//AllocationTableCollection/getAllocationTables"/>
</genClasses>
<genClasses ecoreClass="allocation.ecore#//Allocation">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//Allocation/source"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//Allocation/target"/>
<genOperations ecoreOperation="allocation.ecore#//Allocation/getOneToOneAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//Allocation/getOneToManyAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//Allocation/getManyToOneAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//Allocation/getTarget">
<genParameters ecoreParameter="allocation.ecore#//Allocation/getTarget/source"/>
<genClasses ecoreClass="allocation.ecore#//AllocationTable">
<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/getOneToOneAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getOneToManyAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getManyToOneAllocationEntries"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getTargetElement">
<genParameters ecoreParameter="allocation.ecore#//AllocationTable/getTargetElement/sourceElement"/>
</genOperations>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getTargetElement.1">
<genParameters ecoreParameter="allocation.ecore#//AllocationTable/getTargetElement.1/sourceElements"/>
</genOperations>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getTargetElements">
<genParameters ecoreParameter="allocation.ecore#//AllocationTable/getTargetElements/sourceElement"/>
</genOperations>
<genOperations ecoreOperation="allocation.ecore#//Allocation/getTargets">
<genParameters ecoreParameter="allocation.ecore#//Allocation/getTargets/source"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getSourceElement">
<genParameters ecoreParameter="allocation.ecore#//AllocationTable/getSourceElement/targetElement"/>
</genOperations>
<genOperations ecoreOperation="allocation.ecore#//Allocation/getSource">
<genParameters ecoreParameter="allocation.ecore#//Allocation/getSource/target"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getSourceElement.1">
<genParameters ecoreParameter="allocation.ecore#//AllocationTable/getSourceElement.1/targetElements"/>
</genOperations>
<genOperations ecoreOperation="allocation.ecore#//Allocation/getSources">
<genParameters ecoreParameter="allocation.ecore#//Allocation/getSources/target"/>
<genOperations ecoreOperation="allocation.ecore#//AllocationTable/getSourceElements">
<genParameters ecoreParameter="allocation.ecore#//AllocationTable/getSourceElements/targetElement"/>
</genOperations>
</genClasses>
<genClasses image="false" ecoreClass="allocation.ecore#//AllocationEntry"/>
<genClasses ecoreClass="allocation.ecore#//OneToOneAllocationEntry">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToOneAllocationEntry/source"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToOneAllocationEntry/target"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToOneAllocationEntry/sourceElement"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToOneAllocationEntry/targetElement"/>
</genClasses>
<genClasses ecoreClass="allocation.ecore#//OneToManyAllocationEntry">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToManyAllocationEntry/source"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToManyAllocationEntry/targets"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToManyAllocationEntry/sourceElement"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//OneToManyAllocationEntry/targetElements"/>
</genClasses>
<genClasses image="false" ecoreClass="allocation.ecore#//ManyToOneAllocationEntry">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//ManyToOneAllocationEntry/sources"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//ManyToOneAllocationEntry/target"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//ManyToOneAllocationEntry/sourceElements"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference allocation.ecore#//ManyToOneAllocationEntry/targetElement"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
......@@ -18,12 +18,12 @@ $Id$
package org.fortiss.af3.allocation.compose;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.allocation.model.AllocationTableCollection;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
/**
* {@link IElementCompositor} implementation for the {@link AllocationTable}s.
* {@link IElementCompositor} implementation for the {@link AllocationTableCollection}s.
*
* @author barner
* @author $Author$
......@@ -35,6 +35,6 @@ public final class AllocationTableFileProjectCompositor extends FileProjectCompo
/** {@inheritDoc} */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof AllocationTable;
return contained instanceof AllocationTableCollection;
}
}
......@@ -21,81 +21,32 @@ import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EOperation;
import org.fortiss.af3.allocation.model.Allocation;
import org.fortiss.af3.allocation.model.ManyToOneAllocationEntry;
import org.fortiss.af3.allocation.model.OneToManyAllocationEntry;
import org.fortiss.af3.allocation.model.OneToOneAllocationEntry;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.allocation.model.AllocationTableCollection;
/**
* Implementation of {@link EOperation}s of class {@link Allocation}.
* Implementation of {@link EOperation}s of class {@link AllocationTableCollection}.
*
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash: 7127AD0786EE182852E90D3B4B1A9560
* @ConQAT.Rating YELLOW Hash: 0E9C3F099153F27BF802B1575831C809
*/
public class AllocationStaticImpl {
public class AllocationTableCollectionStaticImpl {
/**
* Returns the {@link OneToOneAllocationEntry}s contained by the given {@link Allocation}.
* Returns the {@link AllocationTable}s contained by the given {@link AllocationTableCollection}
* .
*
* @param allocation
* {@link Allocation} for which to the return the contained
* {@link OneToOneAllocationEntry}s.
* @param allocationTableCollection
* {@link AllocationTableCollection} for which to the return the contained
* {@link AllocationTable}s.
*
* @return {@link OneToOneAllocationEntry}s contained by the given {@link Allocation}.
* @return {@link AllocationTable}s contained by the given {@link AllocationTableCollection}.
*/
public static EList<OneToOneAllocationEntry>
getOneToOneAllocationEntries(Allocation allocation) {
return pickInstanceOf(OneToOneAllocationEntry.class, allocation.getContainedElements());
}
/**
* Returns the {@link OneToManyAllocationEntry}s contained by the given {@link Allocation}.
*
* @param allocation
* {@link Allocation} for which to the return the contained
* {@link OneToManyAllocationEntry}s.
*
* @return {@link OneToManyAllocationEntry}s contained by the given {@link Allocation}.
*/
public static EList<OneToManyAllocationEntry> getOneToManyAllocationEntries(
Allocation allocation) {
return pickInstanceOf(OneToManyAllocationEntry.class, allocation.getContainedElements());
}
/**
* Returns the {@link ManyToOneAllocationEntry}s contained by the given {@link Allocation}.
*
* @param allocation
* {@link Allocation} for which to the return the contained
* {@link ManyToOneAllocationEntry}s.
*
* @return {@link ManyToOneAllocationEntry}s contained by the given {@link Allocation}.
*/
public static EList<ManyToOneAllocationEntry> getManyToOneAllocationEntries(
Allocation allocation) {
return pickInstanceOf(ManyToOneAllocationEntry.class, allocation.getContainedElements());
}
public static IModelElement getTarget(Allocation allocation, IModelElement source) {
// TODO Auto-generated method stub
return null;
}
public static EList<IModelElement> getTargets(Allocation allocation, IModelElement source) {
// TODO Auto-generated method stub
return null;
}
public static IModelElement getSource(Allocation allocation, IModelElement target) {
// TODO Auto-generated method stub
return null;
}
public static EList<IModelElement> getSources(Allocation allocation, IModelElement target) {
// TODO Auto-generated method stub
return null;
public static EList<AllocationTable> getAllocationTables(
AllocationTableCollection allocationTableCollection) {
return pickInstanceOf(AllocationTable.class,
allocationTableCollection.getContainedElements());
}
}
......@@ -19,10 +19,16 @@ package org.fortiss.af3.allocation.model.impl;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import java.util.Set;
import java.util.TreeSet;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EOperation;
import org.fortiss.af3.allocation.model.Allocation;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.allocation.model.ManyToOneAllocationEntry;
import org.fortiss.af3.allocation.model.OneToManyAllocationEntry;
import org.fortiss.af3.allocation.model.OneToOneAllocationEntry;
import org.fortiss.tooling.base.model.element.IModelElement;
/**
* Implementation of {@link EOperation}s of class {@link AllocationTable}.
......@@ -30,19 +36,208 @@ import org.fortiss.af3.allocation.model.AllocationTable;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 0E9C3F099153F27BF802B1575831C809
* @ConQAT.Rating RED Hash: 7127AD0786EE182852E90D3B4B1A9560
*/
public class AllocationTableStaticImpl {
/**
* Returns the {@link Allocation}s contained by the given {@link AllocationTable}.
* Returns the {@link OneToOneAllocationEntry}s contained by the given {@link AllocationTable}.
*
* @param allocationTable
* {@link AllocationTable} for which to the return the contained
* {@link OneToOneAllocationEntry}s.
*
* @return {@link OneToOneAllocationEntry}s contained by the given {@link AllocationTable}.
*/
public static EList<OneToOneAllocationEntry> getOneToOneAllocationEntries(
AllocationTable allocationTable) {
return pickInstanceOf(OneToOneAllocationEntry.class, allocationTable.getContainedElements());
}
/**
* Returns the {@link OneToManyAllocationEntry}s contained by the given {@link AllocationTable}.
*
* @param allocationTable
* {@link AllocationTable} for which to the return the contained
* {@link OneToManyAllocationEntry}s.
*
* @return {@link OneToManyAllocationEntry}s contained by the given {@link AllocationTable}.
*/
public static EList<OneToManyAllocationEntry> getOneToManyAllocationEntries(
AllocationTable allocationTable) {
return pickInstanceOf(OneToManyAllocationEntry.class,
allocationTable.getContainedElements());
}
/**
* Returns the {@link ManyToOneAllocationEntry}s contained by the given {@link AllocationTable}.
*
* @param allocationTable
* {@link AllocationTable} for which to the return the contained
* {@link ManyToOneAllocationEntry}s.
*
* @return {@link ManyToOneAllocationEntry}s contained by the given {@link AllocationTable}.
*/
public static EList<ManyToOneAllocationEntry> getManyToOneAllocationEntries(
AllocationTable allocationTable) {
return pickInstanceOf(ManyToOneAllocationEntry.class,
allocationTable.getContainedElements());
}
/**
* Returns the target element to which the given source element is mapped in a
* {@link OneToOneAllocationEntry}, or {@code null} in case no such mapping has been defined.
*
* @param allocationTable
* {@link AllocationTable} in which to lookup target model element for given source
* model element.