1 package com.calipso.reportgenerator.reportmanager; 2 3 import com.calipso.reportgenerator.reportdefinitions.MetricSourceDefinition; 4 import com.calipso.reportgenerator.reportcalculator.IDataSource; 5 6 7 13 14 public class ReportSourceMetric extends Object { 15 16 private int index; 17 private int dataIndex; 18 private MetricSourceDefinition metricSourceDefinition; 19 20 26 public ReportSourceMetric(MetricSourceDefinition metricSourceDefinition, int index, int dataIndex) { 27 this.metricSourceDefinition = metricSourceDefinition; 28 this.index = index; 29 this.dataIndex = dataIndex; 30 } 31 32 36 public int getIndex() { 37 return index; 38 } 39 40 44 public int getDataIndex() { 45 return dataIndex; 46 } 47 48 53 public MetricSourceDefinition getMetricSourceDefinition() { 54 return metricSourceDefinition; 55 } 56 57 63 public Object getValue(IDataSource dataSource, int index) { 64 if (getMetricSourceDefinition().getCalculated()) { 65 return new Float (0); } 67 else { 68 return new Float (dataSource.getValueAt(index, this.dataIndex).toString()); 70 } 71 } 72 73 74 } 75 | Popular Tags |