Class TotalPageItemCountFunction
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.AbstractFunction
-
- org.pentaho.reporting.engine.classic.core.function.TotalItemCountFunction
-
- org.pentaho.reporting.engine.classic.core.function.TotalPageItemCountFunction
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,PageEventListener
,ReportListener
,AggregationFunction
,Expression
,Function
public class TotalPageItemCountFunction extends TotalItemCountFunction implements PageEventListener
A report function that counts the total number of items contained in groups in a report. Resets the counter with each new page, and with each new group if the optional group parameter is specified. The function will always reset with each new page, so if a group spans across a page break the counter will be still be reset. Like all Total-Functions, this function produces precomputed totals. The function's result is precomputed once and will not change later. The ItemCount can be used to produce a running row-count for a group or report. To count the number of groups in a report, use the TotalGroupCountFunction.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.pentaho.reporting.engine.classic.core.function.TotalItemCountFunction
currentGroupKey
-
-
Constructor Summary
Constructors Constructor Description TotalPageItemCountFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
getInstance()
Return a completly separated copy of this function.Object
getValue()
Returns the number of items counted (so far) by the function.void
groupFinished(ReportEvent event)
If this is the group associated with the function, store away the final valueprotected boolean
isPrepareRunLevel(ReportEvent event)
void
pageFinished(ReportEvent event)
Handles the pageFinishedEvent.void
pageStarted(ReportEvent event)
Handles the pageStartedEvent.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.TotalItemCountFunction
clear, clone, getCrosstabFilterGroup, getGroup, groupStarted, itemsAdvanced, reportInitialized, setCrosstabFilterGroup, setGroup, summaryRowSelection
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setDependencyLevel, setName, setRuntime
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.event.ReportListener
itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted
-
-
-
-
Method Detail
-
isPrepareRunLevel
protected boolean isPrepareRunLevel(ReportEvent event)
- Overrides:
isPrepareRunLevel
in classTotalItemCountFunction
-
groupFinished
public void groupFinished(ReportEvent event)
If this is the group associated with the function, store away the final value- Specified by:
groupFinished
in interfaceReportListener
- Overrides:
groupFinished
in classAbstractFunction
- Parameters:
event
- the event.
-
pageStarted
public void pageStarted(ReportEvent event)
Handles the pageStartedEvent.- Specified by:
pageStarted
in interfacePageEventListener
- Parameters:
event
- the report event.
-
pageFinished
public void pageFinished(ReportEvent event)
Handles the pageFinishedEvent. Stores the current page value and clears the counter. pageFinished can be hit multiple times for a single page, but the stored value should be consistent.- Specified by:
pageFinished
in interfacePageEventListener
- Parameters:
event
- the report event.
-
getValue
public Object getValue()
Description copied from class:TotalItemCountFunction
Returns the number of items counted (so far) by the function. This is either the number of items in the report, or the group (if a group has been defined for the function).- Specified by:
getValue
in interfaceExpression
- Overrides:
getValue
in classTotalItemCountFunction
- Returns:
- The item count.
-
getInstance
public Expression getInstance()
Return a completly separated copy of this function. The copy no longer shares any changeable objects with the original function.- Specified by:
getInstance
in interfaceExpression
- Overrides:
getInstance
in classTotalItemCountFunction
- Returns:
- a copy of this function.
-
-