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

COVERAGE SUMMARY FOR SOURCE FILE [EqualsOperation.java]

nameclass, %method, %block, %line, %
EqualsOperation.java0%   (0/1)0%   (0/8)0%   (0/90)0%   (0/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EqualsOperation0%   (0/1)0%   (0/8)0%   (0/90)0%   (0/19)
EqualsOperation (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getComparePMF (IProbabilityMassFunction, IProbabilityMassFunction): IProbabil... 0%   (0/1)0%   (0/8)0%   (0/1)
getComparePMF (IProbabilityMassFunction, double): IProbabilityMassFunction 0%   (0/1)0%   (0/7)0%   (0/1)
getComparePMF (String, IProbabilityMassFunction): IProbabilityMassFunction 0%   (0/1)0%   (0/31)0%   (0/6)
getComparePMF (String, String): IProbabilityMassFunction 0%   (0/1)0%   (0/12)0%   (0/3)
getComparePMF (boolean, boolean): IProbabilityMassFunction 0%   (0/1)0%   (0/11)0%   (0/3)
getComparePMF (double, IProbabilityMassFunction): IProbabilityMassFunction 0%   (0/1)0%   (0/6)0%   (0/1)
getComparePMF (double, double): IProbabilityMassFunction 0%   (0/1)0%   (0/12)0%   (0/3)

1package de.uka.ipd.sdq.stoex.analyser.operations;
2 
3import java.util.List;
4 
5import de.uka.ipd.sdq.probfunction.math.IProbabilityMassFunction;
6import de.uka.ipd.sdq.probfunction.math.ISample;
7 
8/**
9 * Implements the operation "equals" for different kinds of operands.
10 * 
11 * @author koziolek
12 */
13public class EqualsOperation extends CompareOperation {
14 
15        protected IProbabilityMassFunction getComparePMF(boolean left, boolean right) {
16                if (left == right)
17                        return getBoolPMF(1.0);
18                else
19                        return getBoolPMF(0.0);
20        }
21 
22        protected IProbabilityMassFunction getComparePMF(double left, double right) {
23                if (left == right)
24                        return getBoolPMF(1.0);
25                else
26                        return getBoolPMF(0.0);
27        }
28 
29        protected IProbabilityMassFunction getComparePMF(double left,
30                        IProbabilityMassFunction right) {
31                return compare(right, left);
32        }
33 
34        protected IProbabilityMassFunction getComparePMF(
35                        IProbabilityMassFunction left, double right) {
36                return getBoolPMF(getProbabilityForValue(left, right));
37        }
38 
39        protected IProbabilityMassFunction getComparePMF(
40                        IProbabilityMassFunction left, IProbabilityMassFunction right) {
41                return getBoolPMF(comparePointWise(left, right, this));
42        }
43 
44        protected IProbabilityMassFunction getComparePMF(String left,
45                        IProbabilityMassFunction right) {
46                List<ISample> list = right.getSamples();
47                for (ISample sample : list) {
48                        String sampleString = (String) sample.getValue();
49                        if (left.equals(sampleString)) {
50                                return getBoolPMF(sample.getProbability());
51                        }
52                }
53                return getBoolPMF(0.0);
54        }
55 
56        protected IProbabilityMassFunction getComparePMF(String left, String right) {
57                if (left.equals(right))
58                        return getBoolPMF(1.0);
59                else
60                        return getBoolPMF(0.0);
61        }
62}

[all classes][de.uka.ipd.sdq.stoex.analyser.operations]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov