public class TotalGroupSumFunction extends AbstractFunction implements FieldAggregationFunction
field
parameter is required and denotes the name of an
ItemBand-field which gets summed up.
The parameter group
denotes the name of a group. When this group is started, the counter gets reset to
null. This parameter is optional.Modifier and Type | Field and Description |
---|---|
protected ReportStateKey |
currentGroupKey
The current group key is used to store the result for the current group.
|
protected static BigDecimal |
ZERO
A useful constant representing zero.
|
Constructor and Description |
---|
TotalGroupSumFunction()
Constructs a new function.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clear() |
Object |
clone()
Clones the expression.
|
String |
getCrosstabFilterGroup() |
String |
getField()
Returns the field used by the function.
|
String |
getGroup()
Returns the name of the group to be totalled.
|
Expression |
getInstance()
Return a completly separated copy of this function.
|
Object |
getValue()
Return the current function value.
|
void |
groupStarted(ReportEvent event)
Receives notification that a group has started.
|
protected boolean |
isPrepareRunLevel(ReportEvent event) |
void |
itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed.
|
void |
reportInitialized(ReportEvent event)
Receives notification that the report has started.
|
void |
setCrosstabFilterGroup(String crosstabFilterGroup) |
void |
setField(String field)
Sets the field name for the function.
|
void |
setGroup(String group)
Defines the name of the group to be totalled.
|
void |
summaryRowSelection(ReportEvent event)
A crosstab specific event notifying crosstab-aware functions to select the result for the summary row cell that
will be printed next.
|
groupFinished, itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
groupFinished, itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setDependencyLevel, setName, setRuntime
protected static final BigDecimal ZERO
protected transient ReportStateKey currentGroupKey
public TotalGroupSumFunction()
Initially the function has no name...be sure to assign one before using the function.
public void reportInitialized(ReportEvent event)
reportInitialized
in interface ReportListener
reportInitialized
in class AbstractFunction
event
- the event.protected boolean isPrepareRunLevel(ReportEvent event)
public void groupStarted(ReportEvent event)
groupStarted
in interface ReportListener
groupStarted
in class AbstractFunction
event
- the event.protected void clear()
public void itemsAdvanced(ReportEvent event)
itemsAdvanced
in interface ReportListener
itemsAdvanced
in class AbstractFunction
event
- the event.public Object clone() throws CloneNotSupportedException
AbstractExpression
Expressions maintain no state, cloning is done at the beginning of the report processing to disconnect the expression from any other object space.
clone
in interface Expression
clone
in class AbstractExpression
CloneNotSupportedException
- this should never happen.public void summaryRowSelection(ReportEvent event)
AbstractFunction
summaryRowSelection
in interface ReportListener
summaryRowSelection
in class AbstractFunction
event
- The report event.public String getGroup()
getGroup
in interface AggregationFunction
public void setGroup(String group)
setGroup
in interface AggregationFunction
group
- the group name.public Object getValue()
The value depends (obviously) on the function implementation. For example, a page counting function will return the current page number.
getValue
in interface Expression
public String getField()
getField
in interface FieldAggregationFunction
public void setField(String field)
setField
in interface FieldAggregationFunction
field
- the field name.public Expression getInstance()
getInstance
in interface Expression
getInstance
in class AbstractExpression
public String getCrosstabFilterGroup()
getCrosstabFilterGroup
in interface AggregationFunction
public void setCrosstabFilterGroup(String crosstabFilterGroup)
setCrosstabFilterGroup
in interface AggregationFunction
Copyright © 2002–2017 Pentaho Corporation. All rights reserved.