Package com.inet.report
Class CrossTabBody
java.lang.Object
com.inet.report.CrossTabBody
- All Implemented Interfaces:
Serializable
This is the body of the CrossTab.
- Since:
- 12.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddSummaryField(@Nonnull Field field, int operation) Add a summary to the crosstab.@Nonnull CrossTabBodyCellgetCell(int idx) Get the ith cell of the body.@Nonnull CrossTabBodyCellgetCell(int rowIdx, int columnIdx) Get the cell that is related to the row header and column header.intGet the count of cells in the body.@Nonnull SummaryFieldgetSummaryField(int index) Returns the i-th summary fields of the crosstab.intReturns the number of summary fields of the crosstab.voidmoveSummaryField(int from, int to) Move the position of a summary fieldvoidremoveSummaryField(int index) Removes the ith summary field in from the crosstab.
-
Method Details
-
getCellCount
public int getCellCount()Get the count of cells in the body. This should be row count times column count.- Returns:
- the cell count
- Since:
- 12.0
-
removeSummaryField
Removes the ith summary field in from the crosstab.- Parameters:
index- Index of the summary field.- Throws:
ReportException- if crosstab has no summary field or index is out of bounds.IllegalArgumentException- in case the index is negative.- Since:
- 12.0
-
moveSummaryField
public void moveSummaryField(int from, int to) Move the position of a summary field- Parameters:
from- original position in the range from 0 to getSummaryFieldsCount() -1to- new position in the range from 0 to getSummaryFieldsCount() -1- Throws:
IllegalArgumentException- if a index is out of range- Since:
- 14.1
-
getSummaryField
Returns the i-th summary fields of the crosstab.- Parameters:
index- The 0-based index of the required field.- Returns:
- The i-th summary field.
- Since:
- 12.0
-
getSummaryFieldsCount
public int getSummaryFieldsCount()Returns the number of summary fields of the crosstab.- Returns:
- The number of summary fields.
- Since:
- 12.0
-
addSummaryField
Add a summary to the crosstab.- Parameters:
field- the that should be to sum.operation- the summary operation. Must be a valid constant fromSummaryField- Returns:
- a SummaryField to set additional information
- Since:
- 12.0
-
getCell
Get the ith cell of the body. The order is undefined. You can use this method to iterate over all cells.- Parameters:
idx- the 0 based index.- Returns:
- CrossTabBodyCell, never null
- Since:
- 12.0
- See Also:
-
getCell
Get the cell that is related to the row header and column header.- Parameters:
rowIdx- the 0 based index of the rows.columnIdx- the 0 based index of the columns- Returns:
- the cell, never null
- Throws:
IllegalStateException- if the crosstab is corrupt and the cell can not be found.- Since:
- 12.0
-