Package com.inet.report
Class CrossTabBody
- java.lang.Object
-
- com.inet.report.CrossTabBody
-
- All Implemented Interfaces:
java.io.Serializable
public class CrossTabBody extends java.lang.Object implements java.io.SerializableThis is the body of the CrossTab.- Since:
- 12.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SummaryFieldaddSummaryField(Field field, int operation)Add a summary to the crosstab.CrossTabBodyCellgetCell(int idx)Get the ith cell of the body.CrossTabBodyCellgetCell(int rowIdx, int columnIdx)Get the cell that is related to the row header and column header.intgetCellCount()Get the count of cells in the body.SummaryFieldgetSummaryField(int index)Returns the i-th summary fields of the crosstab.intgetSummaryFieldsCount()Returns 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 Detail
-
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
public void removeSummaryField(int index) throws ReportExceptionRemoves 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.java.lang.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:
java.lang.IllegalArgumentException- if a index is out of range- Since:
- 14.1
-
getSummaryField
@Nonnull public SummaryField getSummaryField(int index)
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
public SummaryField addSummaryField(@Nonnull Field field, int operation)
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
public CrossTabBodyCell getCell(int idx)
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(int, int)
-
getCell
@Nonnull public CrossTabBodyCell getCell(int rowIdx, int columnIdx)
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:
java.lang.IllegalStateException- if the crosstab is corrupt and the cell can not be found.- Since:
- 12.0
-
-