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 |
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 EXCEPTION_MESSAGE_KEY_BUCKET_MEASURE_LIMIT
public static final String EXCEPTION_MESSAGE_KEY_BUCKET_DATA_PROCESSED
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
protected final int bucketMeasureLimit
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 valuesJRException
protected 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.
JRException
public 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
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 checkBucketMeasureCount(int bucketMeasureCount)
public BucketDefinition[] getRowBuckets()
Copyright © 2021 TIBCO Software Inc.. All rights reserved.