1 6 7 package com.sun.japex.report; 8 import java.util.Map ; 9 import java.util.HashMap ; 10 11 15 public class ResultPerDriver { 16 double _harmMean; 17 double _geomMean; 18 double _aritMean; 19 Map _testResults; 20 21 22 public ResultPerDriver() { 23 _testResults = new HashMap (); 24 } 25 public void setHarmMean(String value) { 26 try { 27 _harmMean = Double.parseDouble(value); 28 } catch (NumberFormatException e) { 29 System.out.println(e.getMessage()); 30 } 31 } 32 public double getHarmMean() { 33 return _harmMean; 34 } 35 36 public void setGeomMean(String value) { 37 try { 38 _geomMean = Double.parseDouble(value); 39 } catch (NumberFormatException e) { 40 System.out.println(e.getMessage()); 41 } 42 } 43 public double getGeomMean() { 44 return _geomMean; 45 } 46 47 public void setAritMean(String value) { 48 try { 49 _aritMean = Double.parseDouble(value); 50 } catch (NumberFormatException e) { 51 System.out.println(e.getMessage()); 52 } 53 } 54 public double getAritMean() { 55 return _aritMean; 56 } 57 58 public void addResult(String testName, String value) { 59 try { 60 _testResults.put(testName, new Double (Double.parseDouble(value))); 61 } catch (NumberFormatException e) { 62 System.out.println(e.getMessage()); 63 } 64 65 } 66 public double getResult(String testName) { 67 if (!_testResults.containsKey(testName)) return 0; 68 double value = ((Double )_testResults.get(testName)).doubleValue(); 69 return value; 70 } 71 72 } 73 | Popular Tags |