org.jfree.report.function
Class TotalGroupCountFunction

java.lang.Object
  extended byorg.jfree.report.function.AbstractFunction
      extended byorg.jfree.report.function.GroupCountFunction
          extended byorg.jfree.report.function.TotalGroupCountFunction
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, Expression, Function, ReportListener, java.io.Serializable

public class TotalGroupCountFunction
extends GroupCountFunction

A report function that counts the total of groups in a report. If a null-groupname is given, all groups are counted.

A group can be defined using the property "group". If the group property is not set, all group starts get counted.

Author:
Thomas Morgner
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jfree.report.function.GroupCountFunction
GROUP_PROPERTY, PARENTGROUP_PROPERTY
 
Fields inherited from interface org.jfree.report.function.Expression
AUTOACTIVATE_PROPERTY
 
Constructor Summary
TotalGroupCountFunction()
          Default constructor.
 
Method Summary
protected  int getCount()
          Returns the current group count value.
 Expression getInstance()
          Return a completly separated copy of this function.
 void groupStarted(ReportEvent event)
          Receives notification that a new group is about to start.
 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.
 
Methods inherited from class org.jfree.report.function.GroupCountFunction
getGroup, getParentGroup, getValue, setGroup, setParentGroup
 
Methods inherited from class org.jfree.report.function.AbstractFunction
clone, getDataRow, getDependencyLevel, getName, getProperties, getProperty, getProperty, groupFinished, initialize, isActive, itemsAdvanced, itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted, setDataRow, setDependencyLevel, setName, setProperties, setProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TotalGroupCountFunction

public TotalGroupCountFunction()
Default constructor.

Method Detail

reportInitialized

public void reportInitialized(ReportEvent event)
Receives notification that a new report is about to start. Resets the count.

Specified by:
reportInitialized in interface ReportListener
Overrides:
reportInitialized in class GroupCountFunction
Parameters:
event - the current report event received.

groupStarted

public void groupStarted(ReportEvent event)
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.

Specified by:
groupStarted in interface ReportListener
Overrides:
groupStarted in class GroupCountFunction
Parameters:
event - the current report event received.

getCount

protected int getCount()
Returns the current group count value.

Overrides:
getCount in class GroupCountFunction
Returns:
the curernt group count.

setCount

protected void setCount(int count)
Defines the current group count value.

Overrides:
setCount in class GroupCountFunction
Parameters:
count - the curernt group count.

getInstance

public Expression getInstance()
Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.

Specified by:
getInstance in interface Expression
Overrides:
getInstance in class AbstractFunction
Returns:
a copy of this function.