Class JRFillCrosstabGroup
- java.lang.Object
-
- net.sf.jasperreports.crosstabs.fill.JRFillCrosstabGroup
-
- All Implemented Interfaces:
Cloneable
,JRCrosstabGroup
,JRCloneable
- Direct Known Subclasses:
JRFillCrosstabColumnGroup
,JRFillCrosstabRowGroup
public abstract class JRFillCrosstabGroup extends Object implements JRCrosstabGroup
Base crosstab row/column group implementation used at fill time.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description protected JRFillCellContents
header
protected JRCrosstabGroup
parentGroup
protected JRFillCellContents
totalHeader
protected JRFillVariable
variable
-
Constructor Summary
Constructors Constructor Description JRFillCrosstabGroup(JRCrosstabGroup group, String cellType, JRFillCrosstabObjectFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
JRCrosstabBucket
getBucket()
Returns the bucketing information for this group.JRFillCellContents
getFillHeader()
JRFillCellContents
getFillTotalHeader()
JRFillVariable
getFillVariable()
JRCellContents
getHeader()
Returns the group header cell.Boolean
getMergeHeaderCells()
Determines whether the header cell of this group spans across all entries in the group, or whether the header cell repeats for each sub group entry.String
getName()
Returns the name of the group.JRCellContents
getTotalHeader()
Returns the group total header cell.CrosstabTotalPositionEnum
getTotalPosition()
Returns the position of the total row/column for this group.JRVariable
getVariable()
Returns the variable associated to this group.boolean
hasTotal()
Returns whether the group has a total row/column.
-
-
-
Field Detail
-
parentGroup
protected JRCrosstabGroup parentGroup
-
header
protected JRFillCellContents header
-
totalHeader
protected JRFillCellContents totalHeader
-
variable
protected JRFillVariable variable
-
-
Constructor Detail
-
JRFillCrosstabGroup
public JRFillCrosstabGroup(JRCrosstabGroup group, String cellType, JRFillCrosstabObjectFactory factory)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:JRCrosstabGroup
Returns the name of the group.- Specified by:
getName
in interfaceJRCrosstabGroup
- Returns:
- the name of the group
- See Also:
JRCrosstabGroup.getVariable()
-
getTotalPosition
public CrosstabTotalPositionEnum getTotalPosition()
Description copied from interface:JRCrosstabGroup
Returns the position of the total row/column for this group.A group can have a total row/column summing the values for all the entries in the group. E.g. if there is a Year group having Month as a subgroup, the total row/column for the Year group would sum the values for all the years and the total row/column for the Month group would sum the values for all the months of an year.
Possible values for this attribute are:
CrosstabTotalPositionEnum.NONE
- the group will not display a total row/columnCrosstabTotalPositionEnum.START
- the group will display the total row/column before the group rows/columnsCrosstabTotalPositionEnum.END
- the group will display the total row/column at the end of the group rows/columns
- Specified by:
getTotalPosition
in interfaceJRCrosstabGroup
- Returns:
- the position of the total row/column for this group
-
hasTotal
public boolean hasTotal()
Description copied from interface:JRCrosstabGroup
Returns whether the group has a total row/column.This method is currently equivalent to
getTotalPosition() != Bucket.TOTAL_POSITION_NONE
and is therefore redundant.- Specified by:
hasTotal
in interfaceJRCrosstabGroup
- Returns:
- whether the group has a total row/column
-
getBucket
public JRCrosstabBucket getBucket()
Description copied from interface:JRCrosstabGroup
Returns the bucketing information for this group.The bucketing information consists of grouping expression and group ordering.
- Specified by:
getBucket
in interfaceJRCrosstabGroup
- Returns:
- the bucketing information for this group
-
getHeader
public JRCellContents getHeader()
Description copied from interface:JRCrosstabGroup
Returns the group header cell.The size of the header cell is computed based on the following rules (only the row header rules are listed, the ones for columns can be deducted by symmetrical duality):
- the width of the header is given by
JRCrosstabRowGroup.getWidth()
- the height of the last row group header is given by the height of the base cell
- the height of a non-last row group header is the sum of the next group header's height and the next group total header's height (0 if the next group doesn't have a total header)
Should never return null, but empty cell contents instead.
- Specified by:
getHeader
in interfaceJRCrosstabGroup
- Returns:
- the group header cell
- the width of the header is given by
-
getTotalHeader
public JRCellContents getTotalHeader()
Description copied from interface:JRCrosstabGroup
Returns the group total header cell.The size of a row group total header is computed based on the following rules:
- the width is the sum the widths of this and subsequent row groups
- the height is the height of the base cell for this total row
Should never return null, but empty cell contents instead.
- Specified by:
getTotalHeader
in interfaceJRCrosstabGroup
- Returns:
- the group total header cell
-
getMergeHeaderCells
public Boolean getMergeHeaderCells()
Description copied from interface:JRCrosstabGroup
Determines whether the header cell of this group spans across all entries in the group, or whether the header cell repeats for each sub group entry.If the header cell is set to repeat, the sub group should not have a total row/column.
By default the header cell spans across all entries that are part of the group.
- Specified by:
getMergeHeaderCells
in interfaceJRCrosstabGroup
- Returns:
- whether the header cell should span across entries in the group; if
null
the default will apply
-
getFillHeader
public JRFillCellContents getFillHeader()
-
getFillTotalHeader
public JRFillCellContents getFillTotalHeader()
-
getVariable
public JRVariable getVariable()
Description copied from interface:JRCrosstabGroup
Returns the variable associated to this group.Each group in the crosstab has a variable that can be used inside the group header as the current group value. The variable has the same name as the group and the same type as the bucket expression of the group.
- Specified by:
getVariable
in interfaceJRCrosstabGroup
- Returns:
- the variable associated to this group
-
getFillVariable
public JRFillVariable getFillVariable()
-
clone
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classObject
-
-