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

COVERAGE SUMMARY FOR SOURCE FILE [PerformanceVisitor.java]

nameclass, %method, %block, %line, %
PerformanceVisitor.java0%   (0/2)0%   (0/23)0%   (0/199)0%   (0/62)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PerformanceVisitor0%   (0/1)0%   (0/18)0%   (0/138)0%   (0/48)
PerformanceVisitor (): void 0%   (0/1)0%   (0/9)0%   (0/3)
PerformanceVisitor (PerformanceAlternativeHandler, PerformanceLoopHandler, Pe... 0%   (0/1)0%   (0/18)0%   (0/7)
PerformanceVisitor (PerformanceHandlerFactory): void 0%   (0/1)0%   (0/23)0%   (0/7)
access$0 (PerformanceVisitor): PerformanceAlternativeHandler 0%   (0/1)0%   (0/3)0%   (0/1)
access$1 (PerformanceVisitor): PerformanceLoopHandler 0%   (0/1)0%   (0/3)0%   (0/1)
access$2 (PerformanceVisitor): PerformanceSequenceHandler 0%   (0/1)0%   (0/3)0%   (0/1)
access$3 (PerformanceVisitor): PerformanceSymbolHandler 0%   (0/1)0%   (0/3)0%   (0/1)
getAltHandler (): AlternativeHandler 0%   (0/1)0%   (0/3)0%   (0/1)
getLoopHandler (): LoopHandler 0%   (0/1)0%   (0/3)0%   (0/1)
getResponseTime (Expression): IProbabilityDensityFunction 0%   (0/1)0%   (0/24)0%   (0/7)
getSeqHandler (): SequenceHandler 0%   (0/1)0%   (0/3)0%   (0/1)
getSymHandler (): SymbolHandler 0%   (0/1)0%   (0/3)0%   (0/1)
reset (): void 0%   (0/1)0%   (0/4)0%   (0/2)
setAltHandler (PerformanceAlternativeHandler): void 0%   (0/1)0%   (0/4)0%   (0/2)
setLoopHandler (PerformanceLoopHandler): void 0%   (0/1)0%   (0/4)0%   (0/2)
setPDFTable (Hashtable): void 0%   (0/1)0%   (0/20)0%   (0/6)
setSeqHandler (PerformanceSequenceHandler): void 0%   (0/1)0%   (0/4)0%   (0/2)
setSymHandler (PerformanceSymbolHandler): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class PerformanceVisitor$10%   (0/1)0%   (0/5)0%   (0/61)0%   (0/15)
PerformanceVisitor$1 (PerformanceVisitor): void 0%   (0/1)0%   (0/6)0%   (0/2)
caseAlternative (Alternative): Object 0%   (0/1)0%   (0/19)0%   (0/4)
caseLoop (Loop): Object 0%   (0/1)0%   (0/12)0%   (0/3)
caseSequence (Sequence): Object 0%   (0/1)0%   (0/17)0%   (0/4)
caseSymbol (Symbol): Object 0%   (0/1)0%   (0/7)0%   (0/2)

1package de.uka.ipd.sdq.spa.basicsolver.visitor;
2 
3import java.util.Hashtable;
4 
5import de.uka.ipd.sdq.probfunction.math.IProbabilityDensityFunction;
6import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInFrequencyDomainException;
7import de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler.PerformanceAlternativeHandler;
8import de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler.PerformanceHandlerFactory;
9import de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler.PerformanceLoopHandler;
10import de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler.PerformanceSequenceHandler;
11import de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler.PerformanceSymbolHandler;
12import de.uka.ipd.sdq.spa.expression.Alternative;
13import de.uka.ipd.sdq.spa.expression.Expression;
14import de.uka.ipd.sdq.spa.expression.Loop;
15import de.uka.ipd.sdq.spa.expression.Sequence;
16import de.uka.ipd.sdq.spa.expression.Symbol;
17import de.uka.ipd.sdq.spa.expression.util.ExpressionSwitch;
18 
19public class PerformanceVisitor {
20 
21        private PerformanceAlternativeHandler altHandler;
22 
23        private PerformanceLoopHandler loopHandler;
24 
25        private PerformanceSequenceHandler seqHandler;
26 
27        private PerformanceSymbolHandler symHandler;
28 
29        private Hashtable<Expression, IProbabilityDensityFunction> pdfTable;
30        
31        private ExpressionSwitch exprswitch = new ExpressionSwitch() {
32 
33                @Override
34                public Object caseAlternative(Alternative alternative) {
35                        doSwitch(alternative.getLeftOption().getRegexp());
36                        doSwitch(alternative.getRightOption().getRegexp());
37                        altHandler.handle(alternative);
38                        return alternative;
39                }
40 
41                @Override
42                public Object caseLoop(Loop loop) {
43                        doSwitch(loop.getRegExp());
44                        loopHandler.handle(loop);
45                        return loop;
46                }
47 
48                @Override
49                public Object caseSequence(Sequence sequence) {
50                        doSwitch(sequence.getLeftRegExp());
51                        doSwitch(sequence.getRightRegExp());
52                        seqHandler.handle(sequence);
53                        return sequence;
54                }
55 
56                @Override
57                public Object caseSymbol(Symbol symbol) {
58                        symHandler.handle(symbol);
59                        return symbol;
60                }
61 
62        };
63 
64        
65        private PerformanceVisitor(){
66                super();
67        }
68 
69        public PerformanceVisitor(PerformanceAlternativeHandler altHandler,
70                        PerformanceLoopHandler loopHandler,
71                        PerformanceSequenceHandler seqHandler,
72                        PerformanceSymbolHandler symHandler, Hashtable<Expression, IProbabilityDensityFunction> pdfTable) {
73                this();
74                this.altHandler = altHandler;
75                this.loopHandler = loopHandler;
76                this.seqHandler = seqHandler;
77                this.symHandler = symHandler;
78                this.pdfTable = pdfTable;
79        }
80 
81        public PerformanceVisitor(PerformanceHandlerFactory factory) {
82                this();
83                this.altHandler = factory.createAlternativeHandler();
84                this.seqHandler = factory.createSequenceHandler();
85                this.loopHandler = factory.createLoopHandler();
86                this.symHandler = factory.createSymbolHandler();
87                pdfTable = factory.getPdfTable();
88        }
89 
90        public IProbabilityDensityFunction getResponseTime(
91                        Expression expression) {
92                try {
93                        if (pdfTable.get(expression) == null) {
94                                exprswitch.doSwitch(expression);
95                        }
96                        return pdfTable.get(expression).getInverseFourierTransform();
97                } catch (FunctionNotInFrequencyDomainException e) {
98                        e.printStackTrace();
99                        System.exit(1);
100                }
101                return null;
102        }
103 
104        public void reset() {
105                pdfTable.clear();
106        }
107 
108        public void setPDFTable(
109                        Hashtable<Expression, IProbabilityDensityFunction> pdfTable) {
110                this.pdfTable = pdfTable;
111                loopHandler.setPdfTable(pdfTable);
112                altHandler.setPdfTable(pdfTable);
113                seqHandler.setPdfTable(pdfTable);
114                symHandler.setPdfTable(pdfTable);
115        }
116 
117        public AlternativeHandler getAltHandler() {
118                return altHandler;
119        }
120 
121        public void setAltHandler(PerformanceAlternativeHandler altHandler) {
122                this.altHandler = altHandler;
123        }
124 
125        public LoopHandler getLoopHandler() {
126                return loopHandler;
127        }
128 
129        public void setLoopHandler(PerformanceLoopHandler loopHandler) {
130                this.loopHandler = loopHandler;
131        }
132 
133        public SequenceHandler getSeqHandler() {
134                return seqHandler;
135        }
136 
137        public void setSeqHandler(PerformanceSequenceHandler seqHandler) {
138                this.seqHandler = seqHandler;
139        }
140 
141        public SymbolHandler getSymHandler() {
142                return symHandler;
143        }
144 
145        public void setSymHandler(PerformanceSymbolHandler symHandler) {
146                this.symHandler = symHandler;
147        }
148}

[all classes][de.uka.ipd.sdq.spa.basicsolver.visitor]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov