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 [BytesizeAddingSetVariableActionDescriptor.java]

nameclass, %method, %block, %line, %
BytesizeAddingSetVariableActionDescriptor.java0%   (0/1)0%   (0/5)0%   (0/86)0%   (0/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BytesizeAddingSetVariableActionDescriptor0%   (0/1)0%   (0/5)0%   (0/86)0%   (0/21)
BytesizeAddingSetVariableActionDescriptor (VariableUsage, BytesizeComputation... 0%   (0/1)0%   (0/10)0%   (0/4)
getBytesizeString (OperationSignature, BytesizeComputationForSignature$Modifi... 0%   (0/1)0%   (0/6)0%   (0/2)
getSignatureDependentVariableUsages (OperationSignature): Collection 0%   (0/1)0%   (0/61)0%   (0/12)
getVariableUsages (): Collection 0%   (0/1)0%   (0/5)0%   (0/1)
setCurrentSignature (OperationSignature): void 0%   (0/1)0%   (0/4)0%   (0/2)

1package de.uka.ipd.sdq.pcm.transformations.builder.seff;
2 
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.List;
6 
7import de.uka.ipd.sdq.pcm.parameter.VariableCharacterisation;
8import de.uka.ipd.sdq.pcm.parameter.VariableCharacterisationType;
9import de.uka.ipd.sdq.pcm.parameter.VariableUsage;
10import de.uka.ipd.sdq.pcm.repository.OperationSignature;
11import de.uka.ipd.sdq.pcm.transformations.BytesizeComputationForSignature;
12import de.uka.ipd.sdq.pcm.transformations.BytesizeComputationForSignature.Modifier;
13 
14/**
15 * Adjust a single variable usage by adding the bytesize characterisations of the current signature
16 * The bytesize information is added to the first bytesize variable characterisation of the passed 
17 * VariableUsage.
18 * 
19 * @author martens
20 *
21 */
22public class BytesizeAddingSetVariableActionDescriptor extends
23                SetVariableActionDescriptor implements ISignatureDependentAction {
24 
25        private OperationSignature currentSignature;
26 
27        private Modifier modifier;
28 
29        private VariableUsage variableUsage;
30 
31//        public BytesizeAddingSetVariableActionDescriptor(String variableName,
32//                        VariableCharacterisationType varCharacterisation, String specification,
33//                        Modifier modifier) {
34//                // not nice here, but I cannot create the variable usage yet
35//                super(ParameterFactory.eINSTANCE.createVariableUsage());
36//                
37//                this.variableName = variableName;
38//                this.variableCharacterisation = varCharacterisation;
39//                this.specification = specification;
40//                this.modifier = modifier;
41//        }
42 
43        public BytesizeAddingSetVariableActionDescriptor(
44                        VariableUsage variableUsage, Modifier modifier) {
45                super(variableUsage);
46                this.variableUsage = variableUsage;
47                this.modifier = modifier;
48        }
49 
50        public void setCurrentSignature(OperationSignature sig) {
51                this.currentSignature = sig;
52 
53        }
54 
55        @Override
56        protected Collection<? extends VariableUsage> getVariableUsages() {
57                return getSignatureDependentVariableUsages(this.currentSignature);
58        }
59 
60        protected Collection<? extends VariableUsage> getSignatureDependentVariableUsages(OperationSignature currentSignature){
61                String byteSizeString = getBytesizeString(this.currentSignature, this.modifier);
62                
63                VariableCharacterisation bytesizeCharacterisation = null;
64                for (VariableCharacterisation vc : this.variableUsage.getVariableCharacterisation_VariableUsage()) {
65                        if (vc.getType().equals(VariableCharacterisationType.BYTESIZE)){
66                                bytesizeCharacterisation = vc; 
67                                break;
68                        }
69                }
70                if (bytesizeCharacterisation != null){
71                        String oldSpec = bytesizeCharacterisation.getSpecification_VariableCharacterisation().getSpecification();
72                        bytesizeCharacterisation.getSpecification_VariableCharacterisation().setSpecification(oldSpec + " + "+byteSizeString);
73                }
74                List<VariableUsage> result = new ArrayList<VariableUsage>(1);
75                result.add(this.variableUsage);
76                return result;
77                
78        }
79        
80        private String getBytesizeString(OperationSignature currentSignature, Modifier modifier){
81                String specification = BytesizeComputationForSignature.getBytesizeForSignature(currentSignature, modifier);
82                return specification;
83        }
84 
85}

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