EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.transformations.builder.seff]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractInternalActionDescriptor.java]

nameclass, %method, %block, %line, %
AbstractInternalActionDescriptor.java0%   (0/1)0%   (0/5)0%   (0/55)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractInternalActionDescriptor0%   (0/1)0%   (0/5)0%   (0/55)0%   (0/18)
AbstractInternalActionDescriptor (ProcessingResourceType): void 0%   (0/1)0%   (0/6)0%   (0/3)
createAction (): AbstractAction 0%   (0/1)0%   (0/7)0%   (0/1)
createInternalAction (ProcessingResourceType, String): InternalAction 0%   (0/1)0%   (0/27)0%   (0/8)
getResourceType (): ProcessingResourceType 0%   (0/1)0%   (0/3)0%   (0/1)
getSaveResourceDemand (String): String 0%   (0/1)0%   (0/12)0%   (0/5)

1package de.uka.ipd.sdq.pcm.transformations.builder.seff;
2 
3import de.uka.ipd.sdq.pcm.core.CoreFactory;
4import de.uka.ipd.sdq.pcm.core.PCMRandomVariable;
5import de.uka.ipd.sdq.pcm.resourcetype.ProcessingResourceType;
6import de.uka.ipd.sdq.pcm.seff.AbstractAction;
7import de.uka.ipd.sdq.pcm.seff.InternalAction;
8import de.uka.ipd.sdq.pcm.seff.SeffFactory;
9import de.uka.ipd.sdq.pcm.seff.seff_performance.ParametricResourceDemand;
10import de.uka.ipd.sdq.pcm.seff.seff_performance.Seff_performanceFactory;
11 
12/**
13 * @author  Snowball
14 */
15public abstract class AbstractInternalActionDescriptor extends AbstractActionDescriptor {
16 
17        private ProcessingResourceType resourceType;
18        
19        public AbstractInternalActionDescriptor(
20                        ProcessingResourceType resourceType) {
21                super();
22                this.resourceType = resourceType;
23        }
24 
25        public abstract String getResourceDemand();
26 
27        /**
28         * @return
29         */
30        public ProcessingResourceType getResourceType() {
31                return resourceType;
32        }
33 
34        @Override
35        public AbstractAction createAction() {
36                return createInternalAction(getResourceType(), getResourceDemand());
37        }
38 
39        private InternalAction createInternalAction(ProcessingResourceType type, String resourceDemandSpec) {
40                InternalAction action = SeffFactory.eINSTANCE.createInternalAction();
41                ParametricResourceDemand d = Seff_performanceFactory.eINSTANCE.createParametricResourceDemand();
42                d.setRequiredResource_ParametricResourceDemand(type);
43                PCMRandomVariable specification = CoreFactory.eINSTANCE.createPCMRandomVariable();
44                specification.setSpecification(getSaveResourceDemand(resourceDemandSpec));
45                d.setSpecification_ParametericResourceDemand(specification);
46                action.getResourceDemand_Action().add(d);
47                
48                return action;
49        }
50 
51        private String getSaveResourceDemand(String resourceDemandSpec) {
52                if (resourceDemandSpec == null)
53                        return "0";
54                if (resourceDemandSpec.equals(""))
55                        return "0";
56                return resourceDemandSpec;
57        }
58}

[all classes][de.uka.ipd.sdq.pcm.transformations.builder.seff]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov