Skip to content
Snippets Groups Projects
Commit 31453541 authored by Simon Barner's avatar Simon Barner
Browse files

Eliminate support for multi-instance annotations, which was mostly unused and...

Eliminate support for multi-instance annotations, which was mostly unused and only complicated the code.
refs 2964
parent 5d7f9317
No related branches found
No related tags found
No related merge requests found
ComponentImplDiversityRefValueProvider.java 76cb8a45b2ca645cddf3956f8206f9280b8d571f RED
ComponentImplDiversityRefValueProvider.java d2cbe7d1acefd9941a766ea7cf2ac958a4347ef6 RED
......@@ -17,13 +17,8 @@ package org.fortiss.af3.exploration.alg.annotation.valueprovider;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.component.utils.ComponentArchitectureUtils;
......@@ -116,23 +111,12 @@ public class ComponentImplDiversityRefValueProvider extends
return level;
}
/** {@link EStructuralFeature}s managed by this {@link IAnnotationValueProvider}. */
private static Map<String, EStructuralFeatureDescriptor> createStructuralFeatureDescriptorMap() {
Map<String, EStructuralFeatureDescriptor> rval =
new HashMap<String, EStructuralFeatureDescriptor>();
rval.put(IAnnotationValueProvider.DEFAULT_KEY,
new DiversityRefFilterEStructuralFeatureDescriptor(
AnnotationPackage.Literals.COMPONENT_DIVERSE_IMPL_REF__COMPONENT_REF,
EStructuralFeatureDescriptor.EReferenceScope.PROJECT));
return Collections.unmodifiableMap(rval);
}
/** Constructs a value provider for the (derived) {@link ComponentDiverseImplRef} annotation. */
public ComponentImplDiversityRefValueProvider() {
super(AnnotationPackage.Literals.COMPONENT_DIVERSE_IMPL_REF,
createStructuralFeatureDescriptorMap());
new DiversityRefFilterEStructuralFeatureDescriptor(
AnnotationPackage.Literals.COMPONENT_DIVERSE_IMPL_REF__COMPONENT_REF,
EStructuralFeatureDescriptor.EReferenceScope.PROJECT));
}
/** {@inheritDoc} */
......
AF3DeploymentParameterMapAdapter.java 49170bb0ad34e91ccc957f98fe2ab2b76ea3d2a9 RED
AF3DeploymentParameterMapAdapter.java 0ddaa1c4eb1cbe2daf72854b266acfe8f85c6e70 RED
......@@ -47,8 +47,9 @@ public class AF3DeploymentParameterMapAdapter {
public AF3DeploymentParameterMapAdapter(Set<Deployment> af3DeploymentList) {
componentParamDeploymentMap = new HashMap<Component, Deployment>();
for(Deployment singleParamDeployment : af3DeploymentList) {
ComponentArchitecture refCompArch = (ComponentArchitecture)singleParamDeployment
.getComponentArchitectureReference().getReference();
ComponentArchitecture refCompArch =
(ComponentArchitecture)singleParamDeployment
.getComponentArchitectureReference().getReference();
Collection<Component> containedComponents =
getChildrenWithType(refCompArch, Component.class);
for(Component currentComponent : containedComponents) {
......@@ -63,8 +64,9 @@ public class AF3DeploymentParameterMapAdapter {
boolean validAf3Elements = (af3Component != null && af3ExecutionUnit != null);
Deployment associatedParamDeployment = componentParamDeploymentMap.get(af3Component);
Object wcetValue = associatedParamDeployment.getDeploymentParameter(af3Component,
af3ExecutionUnit, Wcet.class, null);
Object wcetValue =
associatedParamDeployment.getDeploymentParameter(af3Component, af3ExecutionUnit,
Wcet.class);
return (validAf3Elements && wcetValue != null) ? ((BigDecimal)wcetValue).doubleValue()
: -1.0;
}
......@@ -76,8 +78,9 @@ public class AF3DeploymentParameterMapAdapter {
boolean validAf3Elements = (af3Component != null && af3ExecutionUnit != null);
Deployment associatedParamDeployment = componentParamDeploymentMap.get(af3Component);
Object energyValue = associatedParamDeployment.getDeploymentParameter(af3Component,
af3ExecutionUnit, EnergyConsumption.class, null);
Object energyValue =
associatedParamDeployment.getDeploymentParameter(af3Component, af3ExecutionUnit,
EnergyConsumption.class);
return (validAf3Elements && energyValue != null) ? (Double)energyValue : -1.0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment