|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jasperreports.crosstabs.fill.calculation.BucketingService
Crosstab bucketing engine.
Nested Class Summary | |
protected class |
BucketingService.BucketListMap
|
protected class |
BucketingService.BucketMap
|
protected class |
BucketingService.BucketTreeMap
|
protected static class |
BucketingService.CollectedList
|
protected static class |
BucketingService.MapEntry
|
Field Summary | |
protected BucketDefinition[] |
allBuckets
|
protected BucketDefinition[][] |
buckets
|
protected BucketingService.BucketMap |
bucketValueMap
|
protected CrosstabCell[][] |
cells
|
protected HeaderCell[][] |
colHeaders
|
protected long |
dataCount
|
protected static byte |
DIMENSION_COLUMN
|
protected static byte |
DIMENSION_ROW
|
protected static int |
DIMENSIONS
|
protected int[] |
measureIndexes
|
protected MeasureDefinition[] |
measures
|
protected int |
origMeasureCount
|
protected boolean |
processed
|
protected HeaderCell[][] |
rowHeaders
|
protected boolean |
sorted
|
Constructor Summary | |
BucketingService(java.util.List rowBuckets,
java.util.List columnBuckets,
java.util.List measures,
boolean sorted,
boolean computeGrandTotal)
Creates a crosstab bucketing engine. |
Method Summary | |
void |
addData(java.lang.Object[] bucketValues,
java.lang.Object[] measureValues)
Feeds data to the engine. |
protected void |
addMeasure(MeasureDefinition measure,
int index,
java.util.List measuresList,
java.util.List measureIndexList)
|
protected void |
checkTotals(boolean computeGrandTotal)
|
void |
clear()
Clears all the accumulated and computed data. |
protected void |
collectCols(BucketingService.BucketListMap collectedCols,
BucketingService.BucketMap bucketMap)
|
protected void |
computeColumnTotal(BucketingService.BucketMap bucketMap)
|
protected void |
computeRowTotals(BucketingService.BucketMap bucketMap)
|
protected void |
computeTotals(BucketingService.BucketMap bucketMap)
|
protected BucketingService.BucketMap |
createBucketMap(int level)
|
protected BucketingService.BucketListMap |
createCollectBucketMap(int level)
|
protected void |
createCrosstab()
|
protected HeaderCell[][] |
createHeaders(byte dimension,
BucketingService.CollectedList[] headersLists)
|
protected BucketingService.CollectedList |
createHeadersList(byte dimension,
BucketingService.BucketMap bucketMap,
int level,
boolean total)
|
protected void |
fillCell(int[] pos,
java.util.List vals,
java.util.Map.Entry bucketEntry)
|
protected void |
fillCells(BucketingService.CollectedList[] collectedHeaders,
BucketingService.BucketMap bucketMap,
int level,
int[] pos,
java.util.List vals)
|
protected void |
fillHeaders(byte dimension,
HeaderCell[][] headers,
int level,
int col,
BucketingService.CollectedList list,
java.util.List vals)
|
protected BucketDefinition.Bucket[] |
getBucketValues(java.lang.Object[] bucketValues)
|
HeaderCell[][] |
getColumnHeaders()
Returns the crosstab column headers. |
CrosstabCell[][] |
getCrosstabCells()
Returns the crosstab data cells. |
MeasureDefinition.MeasureValue[] |
getGrandTotals()
Returns the grand total measure values. |
MeasureDefinition.MeasureValue[] |
getMeasureValues(BucketDefinition.Bucket[] bucketValues)
Returns the measure values for a set of bucket values. |
HeaderCell[][] |
getRowHeaders()
Returns the crosstab row headers. |
protected MeasureDefinition.MeasureValue[] |
getUserMeasureValues(MeasureDefinition.MeasureValue[] values)
|
boolean |
hasData()
Checks whether there is any data accumulated by the engine. |
protected MeasureDefinition.MeasureValue[] |
initMeasureValues()
|
protected MeasureDefinition.MeasureValue[] |
initUserMeasureValues()
|
void |
processData()
Processes the data which was fed to the engine. |
protected void |
sumVals(MeasureDefinition.MeasureValue[] totals,
MeasureDefinition.MeasureValue[] vals)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final byte DIMENSION_ROW
protected static final byte DIMENSION_COLUMN
protected static final int DIMENSIONS
protected BucketDefinition[] allBuckets
protected BucketDefinition[][] buckets
protected MeasureDefinition[] measures
protected int origMeasureCount
protected int[] measureIndexes
protected final boolean sorted
protected BucketingService.BucketMap bucketValueMap
protected long dataCount
protected boolean processed
protected HeaderCell[][] colHeaders
protected HeaderCell[][] rowHeaders
protected CrosstabCell[][] cells
Constructor Detail |
public BucketingService(java.util.List rowBuckets, java.util.List columnBuckets, java.util.List measures, boolean sorted, boolean computeGrandTotal)
rowBuckets
- the row bucket definitionscolumnBuckets
- the column bucket definitionsmeasures
- the measure definitionssorted
- whether the data is presortedcomputeGrandTotal
- whether grand total computation is requiredMethod Detail |
protected void checkTotals(boolean computeGrandTotal)
public void clear()
protected BucketingService.BucketMap createBucketMap(int level)
protected BucketingService.BucketListMap createCollectBucketMap(int level)
protected void addMeasure(MeasureDefinition measure, int index, java.util.List measuresList, java.util.List measureIndexList)
public void addData(java.lang.Object[] bucketValues, java.lang.Object[] measureValues) throws JRException
bucketValues
- the bucket valuesmeasureValues
- the measure values
JRException
protected BucketDefinition.Bucket[] getBucketValues(java.lang.Object[] bucketValues)
protected MeasureDefinition.MeasureValue[] initMeasureValues()
protected MeasureDefinition.MeasureValue[] initUserMeasureValues()
public void processData() throws JRException
This method should be called after the data has been exhausted. The processing consists of total calculations and crosstab table creation.
JRException
public boolean hasData()
true
iff the engine has any accumulated datapublic HeaderCell[][] getColumnHeaders()
processData()
has to be called before this.
public HeaderCell[][] getRowHeaders()
processData()
has to be called before this.
public CrosstabCell[][] getCrosstabCells()
processData()
has to be called before this.
public MeasureDefinition.MeasureValue[] getMeasureValues(BucketDefinition.Bucket[] bucketValues)
bucketValues
- the bucket values
protected MeasureDefinition.MeasureValue[] getUserMeasureValues(MeasureDefinition.MeasureValue[] values)
public MeasureDefinition.MeasureValue[] getGrandTotals()
protected void computeTotals(BucketingService.BucketMap bucketMap) throws JRException
JRException
protected void sumVals(MeasureDefinition.MeasureValue[] totals, MeasureDefinition.MeasureValue[] vals) throws JRException
JRException
protected void computeColumnTotal(BucketingService.BucketMap bucketMap) throws JRException
JRException
protected void computeRowTotals(BucketingService.BucketMap bucketMap) throws JRException
JRException
protected void createCrosstab() throws JRException
JRException
protected void collectCols(BucketingService.BucketListMap collectedCols, BucketingService.BucketMap bucketMap) throws JRException
JRException
protected BucketingService.CollectedList createHeadersList(byte dimension, BucketingService.BucketMap bucketMap, int level, boolean total)
protected HeaderCell[][] createHeaders(byte dimension, BucketingService.CollectedList[] headersLists)
protected void fillHeaders(byte dimension, HeaderCell[][] headers, int level, int col, BucketingService.CollectedList list, java.util.List vals)
protected void fillCells(BucketingService.CollectedList[] collectedHeaders, BucketingService.BucketMap bucketMap, int level, int[] pos, java.util.List vals)
protected void fillCell(int[] pos, java.util.List vals, java.util.Map.Entry bucketEntry)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |