org.jfree.report.function
Class PageTotalFunction

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

public class PageTotalFunction
extends PageFunction

Prints the total number of pages of an report. If a group is specified, this function expects the group to have the manual pagebreak enabled. This function will only work as expected in group mode if the named group has pagebreak set to true.

Author:
Thomas Morgner
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jfree.report.function.Expression
AUTOACTIVATE_PROPERTY
 
Constructor Summary
PageTotalFunction()
          Creates a new page total function.
 
Method Summary
 Expression getInstance()
          Return a completly separated copy of this function.
protected  int getPage()
          Returns the page number.
 void groupStarted(ReportEvent event)
          Receives notification that a group has started.
 void pageStarted(ReportEvent event)
          Receives notification from the report engine that a new page is starting.
 void reportInitialized(ReportEvent event)
          Receives notification that the report has started.
protected  void setPage(int page)
          Sets the page number.
 
Methods inherited from class org.jfree.report.function.PageFunction
getGroup, getStartPage, getValue, initialize, isIgnorePageCancelEvents, pageCanceled, pageFinished, setGroup
 
Methods inherited from class org.jfree.report.function.AbstractFunction
clone, getDataRow, getDependencyLevel, getName, getProperties, getProperty, getProperty, groupFinished, 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

PageTotalFunction

public PageTotalFunction()
Creates a new page total function.

Method Detail

reportInitialized

public void reportInitialized(ReportEvent event)
Receives notification that the report has started.

Specified by:
reportInitialized in interface ReportListener
Overrides:
reportInitialized in class PageFunction
Parameters:
event - the event.

pageStarted

public void pageStarted(ReportEvent event)
Receives notification from the report engine that a new page is starting. Grabs the page number from the report state and stores it.

Prepared data is bound to the display item, the current displayed row.

Specified by:
pageStarted in interface PageEventListener
Overrides:
pageStarted in class PageFunction
Parameters:
event - Information about the event.

groupStarted

public void groupStarted(ReportEvent event)
Receives notification that a group has started.

If no group is specified for the function, then the event is ignored.

Specified by:
groupStarted in interface ReportListener
Overrides:
groupStarted in class PageFunction
Parameters:
event - the event.

setPage

protected void setPage(int page)
Sets the page number.

Overrides:
setPage in class PageFunction
Parameters:
page - the page number.

getPage

protected int getPage()
Returns the page number.

Overrides:
getPage in class PageFunction
Returns:
the page number.

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.