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

nameclass, %method, %block, %line, %
MultOperation.java0%   (0/1)0%   (0/6)0%   (0/62)0%   (0/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MultOperation0%   (0/1)0%   (0/6)0%   (0/62)0%   (0/10)
MultOperation (): void 0%   (0/1)0%   (0/3)0%   (0/1)
calculateOperationForValues (Double, Double): Double 0%   (0/1)0%   (0/7)0%   (0/1)
compute (IProbabilityDensityFunction, double): IProbabilityDensityFunction 0%   (0/1)0%   (0/22)0%   (0/3)
compute (IProbabilityMassFunction, double): IProbabilityMassFunction 0%   (0/1)0%   (0/22)0%   (0/3)
compute (double, double): double 0%   (0/1)0%   (0/4)0%   (0/1)
compute (int, int): int 0%   (0/1)0%   (0/4)0%   (0/1)

1package de.uka.ipd.sdq.stoex.analyser.operations;
2 
3import de.uka.ipd.sdq.probfunction.math.IProbabilityDensityFunction;
4import de.uka.ipd.sdq.probfunction.math.IProbabilityMassFunction;
5import de.uka.ipd.sdq.probfunction.math.exception.DomainNotNumbersException;
6import de.uka.ipd.sdq.probfunction.math.exception.FunctionsInDifferenDomainsException;
7import de.uka.ipd.sdq.probfunction.math.exception.IncompatibleUnitsException;
8import de.uka.ipd.sdq.probfunction.math.exception.UnknownPDFTypeException;
9 
10/**
11 * Implements the operation "multiplication" for different kinds of operands.
12 * @author martens, koziolek
13 */
14public class MultOperation extends TermProductOperation {
15 
16        @Override
17        public double compute(double left, double right) {
18                return left*right;
19        }
20 
21        @Override
22        public int compute(int left, int right) {
23                return left*right;
24        }
25 
26        @Override
27        public IProbabilityMassFunction compute(IProbabilityMassFunction left,
28                        double right) throws DomainNotNumbersException {
29                if (right == 0){
30                        throw new IllegalArgumentException("ProbabilityMassFunction "+left.toString()+" cannot be multiplied with 0, this operation is undefined.");
31                }
32                return left.stretchDomain(right);
33        }
34 
35 
36 
37        @Override
38        public IProbabilityDensityFunction compute(IProbabilityDensityFunction left, double right) throws DomainNotNumbersException {
39                if (right == 0){
40                        throw new IllegalArgumentException("ProbabilityDensityFunction "+left.toString()+" cannot be multiplied with 0, this operation is undefined.");
41                }
42                return left.stretchDomain(right);
43        }
44 
45        @Override
46        protected Double calculateOperationForValues(Double value1, Double value2) {
47                return value1 * value2;
48        }
49 
50}

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