net.sf.jasperreports.crosstabs.fill.calculation

## Class CrosstabBucketingService

- java.lang.Object
- - net.sf.jasperreports.crosstabs.fill.calculation.BucketingService
  - - net.sf.jasperreports.crosstabs.fill.calculation.CrosstabBucketingService

- All Implemented Interfaces:
    BucketingData

      public class CrosstabBucketingService
      extends BucketingService
      implements BucketingData

  Version:
    $Id: CrosstabBucketingService.java 6470 2013-09-03 09:32:21Z lucianc $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `CrosstabBucketingService.CollectedList`
    `protected static class` | `CrosstabBucketingService.CollectedListComparator`
    `protected static class` | `CrosstabBucketingService.OrderedCollectedList`
    `protected static class` | `CrosstabBucketingService.SequentialCollectedList`

    - ### Nested classes/interfaces inherited from class net.sf.jasperreports.crosstabs.fill.calculation.BucketingService

      `BucketingService.BucketListMap, BucketingService.BucketMap, BucketingService.BucketMapMap, BucketingService.MapEntry`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CrosstabCell[][]` | `cells`
    `protected HeaderCell[][]` | `colHeaders`
    `protected HeaderCell[][]` | `rowHeaders`

    - ### Fields inherited from class net.sf.jasperreports.crosstabs.fill.calculation.BucketingService

      `allBuckets, buckets, bucketValueMap, colBucketCount, columnBucketMap, dataCount, DIMENSION_COLUMN, DIMENSION_ROW, DIMENSIONS, measureIndexes, measures, origMeasureCount, processed, PROPERTY_BUCKET_MEASURE_LIMIT, retrieveTotal, rowBucketCount, rowRetrColMax, rowRetrTotalMax, rowRetrTotalMin, rowRetrTotals, serviceContext, sorted, zeroMeasureValues, zeroUserMeasureValues`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CrosstabBucketingService(BucketingServiceContext serviceContext, java.util.List<BucketDefinition> rowBuckets, java.util.List<BucketDefinition> columnBuckets, java.util.List<MeasureDefinition> measures, boolean sorted, boolean[][] retrieveTotal)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `createCrosstab()`
    `protected HeaderCell[][]` | `createHeaders(byte dimension, CrosstabBucketingService.CollectedList[] headersLists, BucketingService.BucketMap totalsMap)`
    `protected CrosstabBucketingService.CollectedList` | `createHeadersList(byte dimension, BucketingService.BucketMap bucketMap, int level, boolean total)`
    `protected void` | `fillCell(int[] pos, java.util.List<BucketDefinition.Bucket> vals, java.util.List<BucketingService.BucketMap> bucketMaps, MeasureDefinition.MeasureValue[] values)`
    `protected void` | `fillCells(CrosstabBucketingService.CollectedList[] collectedHeaders, BucketingService.BucketMap bucketMap, int level, int[] pos, java.util.List<BucketDefinition.Bucket> vals, java.util.List<BucketingService.BucketMap> bucketMaps)`
    `protected void` | `fillHeaders(byte dimension, HeaderCell[][] headers, int level, int col, CrosstabBucketingService.CollectedList list, java.util.List<BucketDefinition.Bucket> vals, BucketingService.BucketMap totalsMap)`
    `BucketDefinition.Bucket` | `getColumnBucket(int columnGroupIndex, java.lang.Object value)`
    `HeaderCell[][]` | `getColumnHeaders()` Returns the crosstab column headers.
    `BucketDefinition.Bucket` | `getColumnTotalBucket(int columnGroupIndex)`
    `CrosstabCell[][]` | `getCrosstabCells()` Returns the crosstab data cells.
    `MeasureDefinition.MeasureValue[]` | `getMeasureTotals(BucketingService.BucketMap bucketMap, BucketDefinition.Bucket bucket)`
    `MeasureDefinition.MeasureValue[]` | `getMeasureValues(BucketingService.BucketMap bucketMap, BucketDefinition.Bucket bucket, java.util.List<BucketDefinition.Bucket> columnValues)`
    `HeaderCell[][]` | `getRowHeaders()` Returns the crosstab row headers.
    `BucketingServiceContext` | `getServiceContext()`
    `protected MeasureDefinition.MeasureValue[][]` | `retrieveHeaderTotals(byte dimension, BucketDefinition.Bucket[] values, BucketingService.BucketMap totalsMap)`
    `protected MeasureDefinition.MeasureValue[][][]` | `retrieveTotals(java.util.List<BucketDefinition.Bucket> vals, java.util.List<BucketingService.BucketMap> bucketMaps)`

    - ### Methods inherited from class net.sf.jasperreports.crosstabs.fill.calculation.BucketingService

      `addData, addMeasure, bucketMeasuresCreated, checkBucketMeasureCount, checkTotals, clear, computeColumnTotal, computeRowTotals, computeTotals, createBucketMap, createBucketMapMap, createRowTotalsBucketMap, getBucketValues, getGrandTotals, getMeasureValues, getRowBuckets, getUserMeasureValues, getZeroUserMeasureValues, hasData, initMeasureValues, initUserMeasureValues, processData, sumVals`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### colHeaders

          protected HeaderCell[][] colHeaders

    - #### rowHeaders

          protected HeaderCell[][] rowHeaders

    - #### cells

          protected CrosstabCell[][] cells

  - ### Constructor Detail

    - #### CrosstabBucketingService

          public CrosstabBucketingService(BucketingServiceContext serviceContext,
                                  java.util.List<BucketDefinition> rowBuckets,
                                  java.util.List<BucketDefinition> columnBuckets,
                                  java.util.List<MeasureDefinition> measures,
                                  boolean sorted,
                                  boolean[][] retrieveTotal)

  - ### Method Detail

    - #### createCrosstab

          public void createCrosstab()
                              throws JRException

      Throws:
        `JRException`

    - #### createHeaders

          protected HeaderCell[][] createHeaders(byte dimension,
                                     CrosstabBucketingService.CollectedList[] headersLists,
                                     BucketingService.BucketMap totalsMap)

    - #### createHeadersList

          protected CrosstabBucketingService.CollectedList createHeadersList(byte dimension,
                                                                 BucketingService.BucketMap bucketMap,
                                                                 int level,
                                                                 boolean total)
                                                                      throws JRException

      Throws:
        `JRException`

    - #### getMeasureTotals

          public MeasureDefinition.MeasureValue[] getMeasureTotals(BucketingService.BucketMap bucketMap,
                                                          BucketDefinition.Bucket bucket)

      Specified by:
        `getMeasureTotals` in interface `BucketingData`

    - #### fillHeaders

          protected void fillHeaders(byte dimension,
                         HeaderCell[][] headers,
                         int level,
                         int col,
                         CrosstabBucketingService.CollectedList list,
                         java.util.List<BucketDefinition.Bucket> vals,
                         BucketingService.BucketMap totalsMap)

    - #### retrieveHeaderTotals

          protected MeasureDefinition.MeasureValue[][] retrieveHeaderTotals(byte dimension,
                                                                BucketDefinition.Bucket[] values,
                                                                BucketingService.BucketMap totalsMap)

    - #### fillCells

          protected void fillCells(CrosstabBucketingService.CollectedList[] collectedHeaders,
                       BucketingService.BucketMap bucketMap,
                       int level,
                       int[] pos,
                       java.util.List<BucketDefinition.Bucket> vals,
                       java.util.List<BucketingService.BucketMap> bucketMaps)

    - #### fillCell

          protected void fillCell(int[] pos,
                      java.util.List<BucketDefinition.Bucket> vals,
                      java.util.List<BucketingService.BucketMap> bucketMaps,
                      MeasureDefinition.MeasureValue[] values)

    - #### retrieveTotals

          protected MeasureDefinition.MeasureValue[][][] retrieveTotals(java.util.List<BucketDefinition.Bucket> vals,
                                                            java.util.List<BucketingService.BucketMap> bucketMaps)

    - #### getColumnHeaders

          public HeaderCell[][] getColumnHeaders()

      Returns the crosstab column headers.

      `processData()` has to be called before this.

      Returns:
        the crosstab column headers

    - #### getRowHeaders

          public HeaderCell[][] getRowHeaders()

      Returns the crosstab row headers.

      `processData()` has to be called before this.

      Returns:
        the crosstab row headers

    - #### getCrosstabCells

          public CrosstabCell[][] getCrosstabCells()

      Returns the crosstab data cells.

      `processData()` has to be called before this.

      Returns:
        the crosstab data cells

    - #### getServiceContext

          public BucketingServiceContext getServiceContext()

      Specified by:
        `getServiceContext` in interface `BucketingData`

    - #### getColumnTotalBucket

          public BucketDefinition.Bucket getColumnTotalBucket(int columnGroupIndex)

      Specified by:
        `getColumnTotalBucket` in interface `BucketingData`

    - #### getColumnBucket

          public BucketDefinition.Bucket getColumnBucket(int columnGroupIndex,
                                                java.lang.Object value)

      Specified by:
        `getColumnBucket` in interface `BucketingData`

    - #### getMeasureValues

          public MeasureDefinition.MeasureValue[] getMeasureValues(BucketingService.BucketMap bucketMap,
                                                          BucketDefinition.Bucket bucket,
                                                          java.util.List<BucketDefinition.Bucket> columnValues)

      Specified by:
        `getMeasureValues` in interface `BucketingData`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com