EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012) |
---|
[all classes][de.uka.ipd.sdq.simucomframework.variables.converter] |
name | class, % | method, % | block, % | line, % |
---|---|---|---|---|
NumberConverter.java | 0% (0/1) | 0% (0/2) | 0% (0/33) | 0% (0/7) |
name | class, % | method, % | block, % | line, % |
---|---|---|---|---|
class NumberConverter | 0% (0/1) | 0% (0/2) | 0% (0/33) | 0% (0/7) |
NumberConverter (): void | 0% (0/1) | 0% (0/3) | 0% (0/1) | |
toDouble (Object): double | 0% (0/1) | 0% (0/30) | 0% (0/6) |
1 | package de.uka.ipd.sdq.simucomframework.variables.converter; |
2 | |
3 | /** |
4 | * Helper class for basic type conversions |
5 | * @author Steffen Becker |
6 | * |
7 | */ |
8 | public class NumberConverter { |
9 | /** |
10 | * Cast the given object to double |
11 | * @param o The object to cast |
12 | * @return The double represented by o |
13 | */ |
14 | public static double toDouble(Object o){ |
15 | if (o instanceof Double){ |
16 | return (Double)o; |
17 | } else if (o instanceof Integer){ |
18 | int i = (Integer)o; |
19 | return i; |
20 | } |
21 | throw new RuntimeException("Can't case "+o+" to double!"); |
22 | } |
23 | } |
[all classes][de.uka.ipd.sdq.simucomframework.variables.converter] |
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov |