EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcmbench.ui.provider]

COVERAGE SUMMARY FOR SOURCE FILE [SignaturePrinter.java]

nameclass, %method, %block, %line, %
SignaturePrinter.java0%   (0/1)0%   (0/7)0%   (0/220)0%   (0/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SignaturePrinter0%   (0/1)0%   (0/7)0%   (0/220)0%   (0/29)
SignaturePrinter (): void 0%   (0/1)0%   (0/3)0%   (0/1)
caseCollectionDataType (CollectionDataType): String 0%   (0/1)0%   (0/13)0%   (0/1)
caseCompositeDataType (CompositeDataType): String 0%   (0/1)0%   (0/3)0%   (0/1)
caseInfrastructureSignature (InfrastructureSignature): String 0%   (0/1)0%   (0/63)0%   (0/8)
caseOperationSignature (OperationSignature): String 0%   (0/1)0%   (0/91)0%   (0/11)
caseParameter (Parameter): String 0%   (0/1)0%   (0/42)0%   (0/6)
casePrimitiveDataType (PrimitiveDataType): String 0%   (0/1)0%   (0/5)0%   (0/1)

1package de.uka.ipd.sdq.pcmbench.ui.provider;
2 
3import de.uka.ipd.sdq.pcm.repository.CollectionDataType;
4import de.uka.ipd.sdq.pcm.repository.CompositeDataType;
5import de.uka.ipd.sdq.pcm.repository.InfrastructureSignature;
6import de.uka.ipd.sdq.pcm.repository.OperationSignature;
7import de.uka.ipd.sdq.pcm.repository.Parameter;
8import de.uka.ipd.sdq.pcm.repository.PrimitiveDataType;
9import de.uka.ipd.sdq.pcm.repository.util.RepositorySwitch;
10 
11public class SignaturePrinter extends RepositorySwitch<String> {
12 
13 
14        @Override
15        public String caseCollectionDataType(CollectionDataType object) {
16                return this.doSwitch(object.getInnerType_CollectionDataType())+"[]";
17        }
18 
19        @Override
20        public String caseCompositeDataType(CompositeDataType object) {
21                return object.getEntityName();
22        }
23 
24        @Override
25        public String casePrimitiveDataType(PrimitiveDataType object) {
26                return object.getType().getLiteral().toLowerCase();
27        }
28 
29        @Override
30        public String caseParameter(Parameter object) {
31                String result = "";
32                if (object.getDataType__Parameter() != null){
33                        result += this.doSwitch(object.getDataType__Parameter());
34                } else {
35                        result += "void";
36                }
37                result += " " + object.getParameterName();
38                return result;
39        }
40 
41        @Override
42        public String caseOperationSignature(OperationSignature object) {
43                String result = "";
44                if (object.getReturnType__OperationSignature() != null)
45                        result += this.doSwitch(object.getReturnType__OperationSignature());
46                else
47                        result += "void";
48                result += " " + object.getEntityName() + "(";
49                for (Parameter p : object.getParameters__OperationSignature()) {
50                        result += this.doSwitch(p) + ", ";
51                }
52                if (object.getParameters__OperationSignature().size() > 0)
53                        result = result.substring(0, result.length()-2);
54                result += ")";
55                return result;
56        }
57        
58        @Override
59        public String caseInfrastructureSignature(InfrastructureSignature object) {
60                String result = "";
61                result += object.getEntityName() + "(";
62                for (Parameter p : object.getParameters__InfrastructureSignature()) {
63                        result += this.doSwitch(p) + ", ";
64                }
65                if (object.getParameters__InfrastructureSignature().size() > 0)
66                        result = result.substring(0, result.length()-2);
67                result += ")";
68                return result;
69        }        
70}

[all classes][de.uka.ipd.sdq.pcmbench.ui.provider]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov