Save This Page
Home » pentaho-reporting-engine-classic-0.8.10 » org » jfree » report » function » [javadoc | source]
org.jfree.report.function
public class: ItemPercentageFunction [javadoc | source]
java.lang.Object
   org.jfree.report.function.AbstractExpression
      org.jfree.report.function.AbstractFunction
         org.jfree.report.function.ItemPercentageFunction

All Implemented Interfaces:
    Function, Expression, Serializable

Calculates the percentage value of a numeric field. The total sum is taken and divided by the number of items counted.
Constructor:
 public ItemPercentageFunction() 
Method from org.jfree.report.function.ItemPercentageFunction Summary:
clone,   getField,   getGroup,   getInstance,   getRoundingMode,   getScale,   getValue,   groupStarted,   isScaleToHundred,   itemsAdvanced,   reportInitialized,   reportStarted,   setDependencyLevel,   setField,   setGroup,   setRoundingMode,   setRuntime,   setScale,   setScaleToHundred
Methods from org.jfree.report.function.AbstractFunction:
groupFinished,   groupStarted,   itemsAdvanced,   itemsFinished,   itemsStarted,   reportDone,   reportFinished,   reportInitialized,   reportStarted
Methods from org.jfree.report.function.AbstractExpression:
clone,   getDataRow,   getDependencyLevel,   getInstance,   getName,   getReportConfiguration,   getResourceBundleFactory,   getRuntime,   isActive,   isDeepTraversing,   isPreserve,   setActive,   setDependencyLevel,   setName,   setPreserve,   setRuntime
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.report.function.ItemPercentageFunction Detail:
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the function.

    Be aware, this does not create a deep copy. If you have complex strucures contained in objects, you have to overwrite this function.

 public String getField() 
    Returns the field used by the function. The field name corresponds to a column name in the report's data-row.
 public String getGroup() 
    Returns the group name.
 public Expression getInstance() 
    Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.
 public int getRoundingMode() 
    Returns the defined rounding mode. This influences the precision of the divide-operation.
 public int getScale() 
    Returns the scale for the divide-operation. The scale influences the precision of the division.
 public Object getValue() 
    Return the current function value.

    Don not count on the correctness of this function until the preparerun has finished.

 public  void groupStarted(ReportEvent event) 
    Receives notification that a group has started.
 public boolean isScaleToHundred() 
    Returns whether the returned value should be scaled to 100.
 public  void itemsAdvanced(ReportEvent event) 
    Receives notification that a row of data is being processed.
 public  void reportInitialized(ReportEvent event) 
    Receives notification that the report has started.
 public  void reportStarted(ReportEvent event) 
    Receives notification that the report has started.
 public  void setDependencyLevel(int level) 
 public  void setField(String field) 
    Sets the field name for the function. The field name corresponds to a column name in the report's data-row.
 public  void setGroup(String name) 
    Sets the group name.

    If a group is defined, the minimum value is reset to zero at the start of every instance of this group.

 public  void setRoundingMode(int roundingMode) 
    Defines the rounding mode. This influences the precision of the divide-operation.
 public  void setRuntime(ExpressionRuntime runtime) 
    Defines the ExpressionRune used in this expression. The ExpressionRuntime is set before the expression receives events or gets evaluated and is unset afterwards. Do not hold references on the runtime or you will create memory-leaks.

    This updates the internal TotalItemSumFunction.

 public  void setScale(int scale) 
    Defines the scale for the divide-operation. The scale influences the precision of the division.
 public  void setScaleToHundred(boolean scaleToHundred) 
    Defines whether the returned value should be scaled to 100.