|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrefinery.report.function.AbstractFunction
com.jrefinery.report.function.ItemPercentageFunction
Calculates the percentage value of a numeric field. The total sum is taken and divided by the number of items counted.
Field Summary | |
static java.lang.String |
FIELD_PROPERTY
Literal text for the 'field' property. |
static java.lang.String |
GROUP_PROPERTY
Literal text for the 'group' property. |
Fields inherited from interface com.jrefinery.report.function.Expression |
AUTOACTIVATE_PROPERTY |
Constructor Summary | |
ItemPercentageFunction()
Creates a new ItemPercentageFunction. |
Method Summary | |
java.lang.Object |
clone()
Returns a clone of the function. |
java.lang.String |
getField()
Returns the field used by the function. |
java.lang.String |
getGroup()
Returns the name of the group to be counted. |
Expression |
getInstance()
Return a completly separated copy of this function. |
java.lang.Object |
getValue()
Return the current function value. |
void |
groupStarted(ReportEvent event)
Receives notification that a group has started. |
void |
initialize()
Checks that the function has been correctly initialized. |
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 |
setField(java.lang.String field)
Sets the field name for the function. |
void |
setGroup(java.lang.String group)
Defines the name of the group to be counted (if the name is null, all groups are counted). |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property for the function. |
Methods inherited from class com.jrefinery.report.function.AbstractFunction |
getDataRow, getDependencyLevel, getName, getProperties, getProperty, getProperty, groupFinished, isActive, itemsFinished, itemsStarted, pageFinished, pageStarted, reportDone, reportFinished, reportStarted, setDataRow, setDependencyLevel, setName, setProperties |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String GROUP_PROPERTY
public static final java.lang.String FIELD_PROPERTY
Constructor Detail |
public ItemPercentageFunction()
Method Detail |
public void initialize() throws FunctionInitializeException
The default implementation checks that the function name is not null, and calls the isInitialized() method (now deprecated).
initialize
in interface Expression
initialize
in class AbstractFunction
FunctionInitializeException
- if the function name is not set or the call to
isInitialized returns false.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 java.lang.Object getValue()
Don not count on the correctness of this function until the preparerun has finished.
getValue
in interface Expression
public java.lang.String getGroup()
public void setGroup(java.lang.String group)
group
- the name of the group (null permitted).public java.lang.String getField()
The field name corresponds to a column name in the report's TableModel.
public void setField(java.lang.String field)
The field name corresponds to a column name in the report's TableModel.
field
- the field name (null not permitted).public void setProperty(java.lang.String name, java.lang.String value)
setProperty
in class AbstractFunction
name
- The property name.value
- The property value.public java.lang.Object clone() throws java.lang.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 Function
clone
in class AbstractFunction
java.lang.CloneNotSupportedException
- this should never happen.public Expression getInstance()
getInstance
in interface Expression
getInstance
in class AbstractFunction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |