|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
org.pentaho.reporting.engine.classic.core.function.AbstractFunction
org.pentaho.reporting.engine.classic.core.function.ItemPercentageFunction
public class ItemPercentageFunction
Calculates the percentage value of a numeric field. The total sum is taken and divided by the number of items counted.
Constructor Summary | |
---|---|
ItemPercentageFunction()
Creates a new ItemPercentageFunction. |
Method Summary | |
---|---|
Object |
clone()
Returns a clone of the function. |
String |
getField()
Returns the field used by the function. |
String |
getGroup()
Returns the group name. |
Expression |
getInstance()
Return a completly separated copy of this function. |
int |
getRoundingMode()
Returns the defined rounding mode. |
int |
getScale()
Returns the scale for the divide-operation. |
Object |
getValue()
Return the current function value. |
void |
groupStarted(ReportEvent event)
Receives notification that a group has started. |
boolean |
isScaleToHundred()
Returns whether the returned value should be scaled to 100. |
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 |
reportStarted(ReportEvent event)
Receives notification that the report has started. |
void |
setDependencyLevel(int level)
Sets the dependency level for the expression. |
void |
setField(String field)
Sets the field name for the function. |
void |
setGroup(String name)
Sets the group name. |
void |
setRoundingMode(int roundingMode)
Defines the rounding mode. |
void |
setRuntime(ExpressionRuntime runtime)
Defines the ExpressionRune used in this expression. |
void |
setScale(int scale)
Defines the scale for the divide-operation. |
void |
setScaleToHundred(boolean scaleToHundred)
Defines whether the returned value should be scaled to 100. |
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction |
---|
groupFinished, itemsFinished, itemsStarted, reportDone, reportFinished |
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression |
---|
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setName, setPreserve |
Methods inherited from class java.lang.Object |
---|
equals, 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, setName |
Constructor Detail |
---|
public ItemPercentageFunction()
Method Detail |
---|
public boolean isScaleToHundred()
public void setScaleToHundred(boolean scaleToHundred)
scaleToHundred
- true, if the value should be scaled to 100, false otherwise.public int getRoundingMode()
BigDecimal.divide(java.math.BigDecimal, int)
public void setRoundingMode(int roundingMode)
roundingMode
- the rounding mode.BigDecimal.divide(java.math.BigDecimal, int)
public int getScale()
public void setScale(int scale)
scale
- the scale.public String getGroup()
public void setGroup(String name)
If a group is defined, the minimum value is reset to zero at the start of every instance of this group.
name
- the group name (null permitted).public String getField()
public void setField(String field)
field
- the field name.public void reportStarted(ReportEvent event)
reportStarted
in interface ReportListener
reportStarted
in class AbstractFunction
event
- the event.public void groupStarted(ReportEvent event)
groupStarted
in interface ReportListener
groupStarted
in class AbstractFunction
event
- the event.public void itemsAdvanced(ReportEvent event)
itemsAdvanced
in interface ReportListener
itemsAdvanced
in class AbstractFunction
event
- the event.public void reportInitialized(ReportEvent event)
reportInitialized
in interface ReportListener
reportInitialized
in class AbstractFunction
event
- the event.public Object getValue()
Don not count on the correctness of this function until the preparerun has finished.
public Object clone() throws CloneNotSupportedException
Be aware, this does not create a deep copy. If you have complex strucures contained in objects, you have to overwrite this function.
clone
in interface Expression
clone
in class AbstractExpression
CloneNotSupportedException
- this should never happen.public Expression getInstance()
getInstance
in interface Expression
getInstance
in class AbstractExpression
public void setDependencyLevel(int level)
AbstractExpression
setDependencyLevel
in interface Expression
setDependencyLevel
in class AbstractExpression
level
- the level (must be greater than or equal to 0).public void setRuntime(ExpressionRuntime runtime)
setRuntime
in interface Expression
setRuntime
in class AbstractExpression
runtime
- the runtime information for the expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |