1 28 package net.sf.jasperreports.crosstabs.fill.calculation; 29 30 import net.sf.jasperreports.crosstabs.fill.calculation.MeasureDefinition.MeasureValue; 31 32 38 public class CrosstabCell 39 { 40 private final BucketDefinition.Bucket[] rowBucketValues; 41 private final int rowTotalGroupIndex; 42 private final BucketDefinition.Bucket[] columnBucketValues; 43 private final int columnTotalGroupIndex; 44 private final MeasureValue[] mesureValues; 45 private final MeasureValue[][][] totals; 46 47 48 56 public CrosstabCell( 57 BucketDefinition.Bucket[] rowBucketValues, 58 BucketDefinition.Bucket[] columnBucketValues, 59 MeasureValue[] mesureValues, 60 MeasureValue[][][] totals) 61 { 62 this.rowBucketValues = rowBucketValues; 63 rowTotalGroupIndex = getTotalIndex(rowBucketValues); 64 this.columnBucketValues = columnBucketValues; 65 columnTotalGroupIndex = getTotalIndex(columnBucketValues); 66 this.mesureValues = mesureValues; 67 this.totals = totals; 68 } 69 70 71 private static int getTotalIndex(BucketDefinition.Bucket[] values) 72 { 73 int i = 0; 74 while (i < values.length && !values[i].isTotal()) 75 { 76 ++i; 77 } 78 79 return i; 80 } 81 82 83 88 public MeasureValue[] getMesureValues() 89 { 90 return mesureValues; 91 } 92 93 94 99 public BucketDefinition.Bucket[] getColumnBucketValues() 100 { 101 return columnBucketValues; 102 } 103 104 105 110 public BucketDefinition.Bucket[] getRowBucketValues() 111 { 112 return rowBucketValues; 113 } 114 115 116 124 public int getColumnTotalGroupIndex() 125 { 126 return columnTotalGroupIndex; 127 } 128 129 130 138 public int getRowTotalGroupIndex() 139 { 140 return rowTotalGroupIndex; 141 } 142 143 144 149 public MeasureValue[][][] getTotals() 150 { 151 return totals; 152 } 153 } 154 | Popular Tags |