public abstract class BucketingService extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
BucketingService.BucketListMap |
class |
BucketingService.BucketMap |
protected class |
BucketingService.BucketMapMap |
protected static class |
BucketingService.MapEntry |
| Modifier and Type | Field and Description |
|---|---|
protected BucketDefinition[] |
allBuckets |
protected BucketDefinition[][] |
buckets |
protected BucketingService.BucketMap |
bucketValueMap |
protected int |
colBucketCount |
protected BucketingService.BucketMap |
columnBucketMap |
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 |
static String |
PROPERTY_BUCKET_MEASURE_LIMIT |
protected boolean[][] |
retrieveTotal |
protected int |
rowBucketCount |
protected int[] |
rowRetrColMax |
protected int |
rowRetrTotalMax |
protected int |
rowRetrTotalMin |
protected boolean[] |
rowRetrTotals |
protected BucketingServiceContext |
serviceContext |
protected boolean |
sorted |
protected MeasureDefinition.MeasureValue[] |
zeroMeasureValues |
protected MeasureDefinition.MeasureValue[] |
zeroUserMeasureValues |
| Constructor and Description |
|---|
BucketingService(BucketingServiceContext serviceContext,
List<BucketDefinition> rowBuckets,
List<BucketDefinition> columnBuckets,
List<MeasureDefinition> measures,
boolean sorted,
boolean[][] retrieveTotal)
Creates a crosstab bucketing engine.
|
public static final String PROPERTY_BUCKET_MEASURE_LIMIT
protected static final byte DIMENSION_ROW
protected static final byte DIMENSION_COLUMN
protected static final int DIMENSIONS
protected final BucketingServiceContext serviceContext
protected final BucketDefinition[] allBuckets
protected final BucketDefinition[][] buckets
protected final int rowBucketCount
protected final int colBucketCount
protected final boolean[][] retrieveTotal
protected boolean[] rowRetrTotals
protected int rowRetrTotalMin
protected int rowRetrTotalMax
protected int[] rowRetrColMax
protected final MeasureDefinition[] measures
protected final int origMeasureCount
protected final int[] measureIndexes
protected final boolean sorted
protected final BucketingService.BucketMap bucketValueMap
protected final BucketingService.BucketMap columnBucketMap
protected long dataCount
protected boolean processed
protected final MeasureDefinition.MeasureValue[] zeroMeasureValues
protected final MeasureDefinition.MeasureValue[] zeroUserMeasureValues
public BucketingService(BucketingServiceContext serviceContext, List<BucketDefinition> rowBuckets, List<BucketDefinition> columnBuckets, List<MeasureDefinition> measures, boolean sorted, boolean[][] retrieveTotal)
serviceContext - rowBuckets - the row bucket definitionscolumnBuckets - the column bucket definitionsmeasures - the measure definitionssorted - whether the data is presortedretrieveTotal - totals to retrieve along with the cell valuesprotected void checkTotals()
public void clear()
protected BucketingService.BucketMap createBucketMap(int level)
protected BucketingService.BucketMapMap createBucketMapMap(int level)
protected BucketingService.BucketMapMap createRowTotalsBucketMap()
protected void addMeasure(MeasureDefinition measure, int index, List<MeasureDefinition> measuresList, List<Integer> measureIndexList)
public void addData(Object[] bucketValues, Object[] measureValues) throws JRException
bucketValues - the bucket valuesmeasureValues - the measure valuesJRExceptionprotected void bucketMeasuresCreated()
protected BucketDefinition.Bucket[] getBucketValues(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.
JRExceptionpublic boolean hasData()
true if and only if the engine has any accumulated datapublic MeasureDefinition.MeasureValue[] getMeasureValues(BucketDefinition.Bucket[] bucketValues)
bucketValues - the bucket valuespublic MeasureDefinition.MeasureValue[] getUserMeasureValues(MeasureDefinition.MeasureValue[] values)
public MeasureDefinition.MeasureValue[] getZeroUserMeasureValues()
public MeasureDefinition.MeasureValue[] getGrandTotals()
protected void computeTotals(BucketingService.BucketMap bucketMap) throws JRException
JRExceptionprotected void sumVals(MeasureDefinition.MeasureValue[] totals, MeasureDefinition.MeasureValue[] vals) throws JRException
JRExceptionprotected void computeColumnTotal(BucketingService.BucketMap bucketMap) throws JRException
JRExceptionprotected void computeRowTotals(BucketingService.BucketMap bucketMap) throws JRException
JRExceptionprotected void checkBucketMeasureCount(int bucketMeasureCount)
public BucketDefinition[] getRowBuckets()
Copyright © 2014. All rights reserved.