| |
|
| java.lang.Object org.jfree.report.function.AbstractExpression org.jfree.report.function.AbstractFunction org.jfree.report.function.GroupCountFunction
All known Subclasses: org.jfree.report.function.TotalGroupCountFunction,
GroupCountFunction | public class GroupCountFunction extends AbstractFunction (Code) | | A report function that counts groups in a report. If a null-groupname is given, all
groups are counted.
The group to be counted can be defined using the property "group". An optional
container group can be defined using the property "parent-group". When the group start
event of that group is encountered, the counter will be reset to '0'.
If the group property is not set, all group starts get counted.
author: David Gilbert |
Method Summary | |
protected int | getCount() Returns the current group count value. | public String | getGroup() Returns the name of the group to be counted. | public String | getParentGroup() Returns the name of the group on which to reset the counter. | public Object | getValue() Returns the number of groups processed so far (including the current group). | public void | groupStarted(ReportEvent event) Receives notification that a new group is about to start. | public void | reportInitialized(ReportEvent event) Receives notification that a new report is about to start. | protected void | setCount(int count) Defines the current group count value. | public void | setGroup(String group) defines the name of the group to be counted. | public void | setParentGroup(String group) defines the name of the group on which to reset the counter. |
GroupCountFunction | public GroupCountFunction()(Code) | | Default constructor.
|
GroupCountFunction | public GroupCountFunction(String name, String group)(Code) | | Constructs a report function for counting groups.
Parameters: name - The function name. Parameters: group - The group name. throws: NullPointerException - if the given name is null |
getCount | protected int getCount()(Code) | | Returns the current group count value.
the curernt group count. |
getGroup | public String getGroup()(Code) | | Returns the name of the group to be counted.
the name of the group or null, if all groups are counted |
getParentGroup | public String getParentGroup()(Code) | | Returns the name of the group on which to reset the counter.
the name of the group or null, if all groups are counted |
getValue | public Object getValue()(Code) | | Returns the number of groups processed so far (including the current group).
the number of groups processed as java.lang.Integer. |
groupStarted | public void groupStarted(ReportEvent event)(Code) | | Receives notification that a new group is about to start. Increases the count if all
groups are counted or the name defines the current group.
Parameters: event - the current report event received. |
reportInitialized | public void reportInitialized(ReportEvent event)(Code) | | Receives notification that a new report is about to start. Resets the count.
Parameters: event - the current report event received. |
setCount | protected void setCount(int count)(Code) | | Defines the current group count value.
Parameters: count - the curernt group count. |
setGroup | public void setGroup(String group)(Code) | | defines the name of the group to be counted. If the name is null, all groups are
counted.
Parameters: group - the name of the group to be counted. |
setParentGroup | public void setParentGroup(String group)(Code) | | defines the name of the group on which to reset the counter. If the name is null, all
groups are counted.
Parameters: group - the name of the group to be counted. |
|
|
|