01: package com.calipso.reportgenerator.reportmanager;
02:
03: import com.calipso.reportgenerator.reportcalculator.Pivot;
04: import com.calipso.reportgenerator.common.ReportQuery;
05: import com.calipso.reportgenerator.common.ReportSpec;
06:
07: import java.util.Iterator;
08: import java.util.Set;
09: import java.io.Serializable;
10:
11: import com.calipso.reportgenerator.common.InfoException;
12:
13: /**
14: * Representa los datos de un reporte.
15: */
16:
17: public abstract class ReportData implements Serializable {
18:
19: private ReportQuery reportQuery;
20: private ReportSpec reportSpec;
21:
22: /**
23: * Constructor de la clase.
24: * @param reportSpec
25: */
26: public ReportData(ReportSpec reportSpec) {
27: this .reportSpec = reportSpec;
28: }
29:
30: public abstract Iterator valuesFor(int dimension,
31: int[] previousDimensions, Object[] values);
32:
33: public abstract ReportDataIterator iterator();
34:
35: public ReportQuery getQuery() {
36: return reportQuery;
37: }
38:
39: public void setQuery(ReportQuery query, Pivot pivot)
40: throws InfoException {
41: reportQuery = query;
42: doSetQuery(query, pivot);
43: }
44:
45: protected abstract void doSetQuery(ReportQuery query, Pivot pivot)
46: throws InfoException;
47:
48: public ReportSpec getDefinition() {
49: return reportSpec;
50: }
51:
52: public abstract Object[] measuresAtDimensionsValues(
53: int[] dimensions, Object[] values);
54:
55: public Set[] getDimensionValues() {
56: return new Set[0];
57: }
58:
59: public abstract Object[] getMetricValues(
60: int[] groupingDimensionsIndexArray, Object[] values);
61:
62: public Set getDimensionValues(int index) throws InfoException {
63: return null;
64: }
65: }
|