public class ItemPercentageFunction extends AbstractFunction
Constructor and Description |
---|
ItemPercentageFunction()
Creates a new ItemPercentageFunction.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a clone of the function.
|
String |
getCrosstabFilterGroup() |
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 |
setCrosstabFilterGroup(String crosstabFilterGroup) |
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.
|
groupFinished, itemsFinished, itemsStarted, reportDone, reportFinished, summaryRowSelection
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setName, setPreserve
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setName
public ItemPercentageFunction()
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 getCrosstabFilterGroup()
public void setCrosstabFilterGroup(String crosstabFilterGroup)
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