Class PaddingController
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.states.datarow.PaddingController
-
- All Implemented Interfaces:
Cloneable
public class PaddingController extends Object implements Cloneable
A datarow that acts as padding source. It overrides the columns from either report-data or expressions datarow with values collected by the crosstab-specification. It also provides padding for the advance calls. There are three padding scenarios that must be covered by this data-row:- Leading columns are missing
The crosstab-specification's current cursor position is not at the computed position for the current column key (the column values read from the actual data-row). Therefore the system has to insert fake columns until the cursor has advanced to the current position. As we are effectively duplicating rows, this may lead to corrupted data if we duplicate non-group-columns.
- Inner columns are missing
After an advance, the computed column-key position is greater than the current cursor position. Therefore the system has to insert fake data until the positions match again.
- Trailing columns are missing
If the advance would trigger a group-break, check whether the current cursor position is already at the end of the columns list. If not, stay on the current row and insert as many fake rows as needed.
- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description PaddingController(CrosstabSpecification crosstabSpecification)
PaddingController(PaddingController dataRow)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(MasterDataRowChangeHandler dataRow)
PaddingController
advance()
PaddingController
clone()
Object[]
createColumnKey(FastGlobalView globalView)
Object[]
createRowKey(FastGlobalView globalView)
int
getCrosstabColumnCount()
CrosstabSpecification
getCrosstabSpecification()
int
getCurrentCursorPosition()
int
getPrePaddingRows(DataRow globalView)
Do we need a case1 padding?void
refreshPaddedRow(MasterDataRowChangeHandler dataRow, ReportDataRow reportDataRow)
void
refreshRow(MasterDataRowChangeHandler dataRow, ReportDataRow reportDataRow)
PaddingController
resetRowCursor()
-
-
-
Constructor Detail
-
PaddingController
public PaddingController(PaddingController dataRow)
-
PaddingController
public PaddingController(CrosstabSpecification crosstabSpecification)
-
-
Method Detail
-
getPrePaddingRows
public int getPrePaddingRows(DataRow globalView)
Do we need a case1 padding?- Parameters:
globalView
-- Returns:
- the number of rows needed for the pre-padding or zero if no pre-padding is required.
-
getCurrentCursorPosition
public int getCurrentCursorPosition()
-
getCrosstabColumnCount
public int getCrosstabColumnCount()
-
advance
public PaddingController advance()
-
activate
public void activate(MasterDataRowChangeHandler dataRow)
-
refreshPaddedRow
public void refreshPaddedRow(MasterDataRowChangeHandler dataRow, ReportDataRow reportDataRow)
-
refreshRow
public void refreshRow(MasterDataRowChangeHandler dataRow, ReportDataRow reportDataRow)
-
resetRowCursor
public PaddingController resetRowCursor()
-
createRowKey
public Object[] createRowKey(FastGlobalView globalView)
-
createColumnKey
public Object[] createColumnKey(FastGlobalView globalView)
-
getCrosstabSpecification
public CrosstabSpecification getCrosstabSpecification()
-
clone
public PaddingController clone()
-
-