1 package com.calipso.reportgenerator.common; 2 3 import java.io.Serializable ; 4 import java.util.Map ; 5 import java.util.Set ; 6 import java.util.Collection ; 7 8 import com.calipso.reportgenerator.common.LanguageTraslator; 9 import com.calipso.reportgenerator.common.ReportQuery; 10 import com.calipso.reportgenerator.common.ReportSpec; 11 12 17 18 public abstract class ReportResult implements Serializable { 19 20 private ReportQuery reportQuery; 21 private ReportSpec reportSpec; 22 23 28 public ReportResult(ReportSpec reportSpec, ReportQuery reportQuery) { 29 this.reportSpec = reportSpec; 30 this.reportQuery = reportQuery; 31 } 32 33 37 public ReportSpec getReportSpec() { 38 return reportSpec; 39 } 40 41 45 public Map getParamValues() { 46 return getReportQuery().getParamValues(); 47 } 48 49 53 public ReportQuery getReportQuery() { 54 return reportQuery; 55 } 56 57 public Set getDimensionUnCheckedValues(String name) throws InfoException { 58 try { 59 QueryDimension dimension = getReportQuery().getQueryDimensionFromName(name); 60 int index = dimension.getIndex(); 61 return getReportQuery().getExcludedValues(index); 62 } catch (Exception e) { 63 throw new InfoException(LanguageTraslator.traslate("148"), e); 64 } 65 } 66 67 public ReportDimensionSpec getDimensionFromName(String name) { 68 return getReportSpec().getDimensionFromName(name); 69 } 70 71 public ReportMetricSpec getMetricFromName(String name) { 72 return getReportSpec().getMetricFromName(name); 73 } 74 75 public abstract ReportTableModel getReportTableModel() throws InfoException; 76 77 public abstract void resetReportTableModel(); 78 79 public abstract Collection getValuesCollection(boolean ascending); 80 } 81 | Popular Tags |