1 package com.calipso.reportgenerator.reportmanager; 2 3 import com.calipso.reportgenerator.reportcalculator.Pivot; 4 import com.calipso.reportgenerator.common.ReportQuery; 5 import com.calipso.reportgenerator.common.ReportSpec; 6 7 import java.util.Iterator ; 8 import java.util.Set ; 9 import java.io.Serializable ; 10 11 import com.calipso.reportgenerator.common.InfoException; 12 13 16 17 public abstract class ReportData implements Serializable { 18 19 private ReportQuery reportQuery; 20 private ReportSpec reportSpec; 21 22 26 public ReportData(ReportSpec reportSpec){ 27 this.reportSpec = reportSpec; 28 } 29 30 public abstract Iterator valuesFor(int dimension, int[] previousDimensions, Object [] values); 31 32 public abstract ReportDataIterator iterator(); 33 34 public ReportQuery getQuery() { 35 return reportQuery; 36 } 37 38 public void setQuery(ReportQuery query, Pivot pivot) throws InfoException { 39 reportQuery = query; 40 doSetQuery(query, pivot); 41 } 42 43 protected abstract void doSetQuery(ReportQuery query, Pivot pivot) throws InfoException; 44 45 public ReportSpec getDefinition() { 46 return reportSpec; 47 } 48 49 public abstract Object [] measuresAtDimensionsValues(int[] dimensions, Object [] values); 50 51 public Set [] getDimensionValues() { 52 return new Set [0]; 53 } 54 55 public abstract Object [] getMetricValues(int[] groupingDimensionsIndexArray, Object [] values); 56 57 public Set getDimensionValues(int index) throws InfoException { 58 return null; 59 } 60 } 61 | Popular Tags |