KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > reportmanager > StaticReportData


1 package com.calipso.reportgenerator.reportmanager;
2
3 import com.calipso.reportgenerator.common.InfoException;
4 import java.util.Iterator JavaDoc;
5 import com.calipso.reportgenerator.reportcalculator.Pivot;
6 import com.calipso.reportgenerator.reportcalculator.DataTree;
7 import com.calipso.reportgenerator.common.ReportQuery;
8 import com.calipso.reportgenerator.common.ReportSpec;
9
10 /**
11  * Representa los datos de un reporte de tipo estatico
12  */

13
14 public class StaticReportData extends ReportData {
15   private DataTree dataTree;
16
17   public Object JavaDoc[] getMetricValues(int[] ints, Object JavaDoc[] objects){
18     return null;
19   }
20   /**
21    * Inicializa una instancia de <code>StaticReportData</code>
22    * @param reportSpec
23    */

24   public StaticReportData(ReportSpec reportSpec){
25     super(reportSpec);
26     dataTree = new DataTree();
27     dataTree.setDefinition(reportSpec);
28   }
29
30
31   public Iterator JavaDoc valuesFor(int dimension, int[] previousDimensions, Object JavaDoc[] values) {
32     return getDataTree().valuesFor(dimension, previousDimensions, values);
33   }
34
35   /**
36    * Retorna el iterador del <code>StaticReportData</code>
37    * @return
38    */

39   public ReportDataIterator iterator() {
40     return new StaticReportDataIterator(getDataTree().iterator());
41   }
42
43   public Object JavaDoc[] measuresAtDimensionsValues(int[] dimensions, Object JavaDoc[] values) {
44     return getDataTree().measuresAtDimensionsValues(dimensions, values);
45   }
46
47   /**
48    * Asigna la <code>StaticQuery</code> a la instancia de <code>DataTree</code>
49    * @param query
50    * @param pivot
51    * @throws InfoException
52    */

53   protected void doSetQuery(ReportQuery query, Pivot pivot) throws InfoException {
54     getDataTree().setQuery(query.getStaticQuery());
55     pivot.fill(getDataTree());
56   }
57
58   /**
59    * Devuelve el <code>DataTree</code> correspondiente al <code>StaticReportData</code>
60    * @return
61    */

62   public DataTree getDataTree() {
63     return dataTree;
64   }
65 }
66
Popular Tags