Class ItemPercentageFunction

    • Constructor Detail

      • ItemPercentageFunction

        public ItemPercentageFunction()
        Creates a new ItemPercentageFunction.
    • Method Detail

      • isScaleToHundred

        public boolean isScaleToHundred()
        Returns whether the returned value should be scaled to 100.
        Returns:
        true, if the value should be scaled to 100, false otherwise.
      • setScaleToHundred

        public void setScaleToHundred​(boolean scaleToHundred)
        Defines whether the returned value should be scaled to 100.
        Parameters:
        scaleToHundred - true, if the value should be scaled to 100, false otherwise.
      • getRoundingMode

        public int getRoundingMode()
        Returns the defined rounding mode. This influences the precision of the divide-operation.
        Returns:
        the rounding mode.
        See Also:
        BigDecimal.divide(java.math.BigDecimal, int)
      • setRoundingMode

        public void setRoundingMode​(int roundingMode)
        Defines the rounding mode. This influences the precision of the divide-operation.
        Parameters:
        roundingMode - the rounding mode.
        See Also:
        BigDecimal.divide(java.math.BigDecimal, int)
      • getScale

        public int getScale()
        Returns the scale for the divide-operation. The scale influences the precision of the division.
        Returns:
        the scale.
      • setScale

        public void setScale​(int scale)
        Defines the scale for the divide-operation. The scale influences the precision of the division.
        Parameters:
        scale - the scale.
      • getGroup

        public String getGroup()
        Returns the group name.
        Returns:
        The group name.
      • setGroup

        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.

        Parameters:
        name - the group name (null permitted).
      • getCrosstabFilterGroup

        public String getCrosstabFilterGroup()
      • setCrosstabFilterGroup

        public void setCrosstabFilterGroup​(String crosstabFilterGroup)
      • getField

        public String getField()
        Returns the field used by the function. The field name corresponds to a column name in the report's data-row.
        Returns:
        The field name.
      • setField

        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.
        Parameters:
        field - the field name.
      • getValue

        public Object getValue()
        Return the current function value.

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

        Returns:
        The value of the function.
      • getInstance

        public Expression getInstance()
        Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.
        Specified by:
        getInstance in interface Expression
        Overrides:
        getInstance in class AbstractExpression
        Returns:
        a copy of this function.
      • setDependencyLevel

        public void setDependencyLevel​(int level)
        Description copied from class: AbstractExpression
        Sets the dependency level for the expression.

        The dependency level controls the order of evaluation for expressions and functions. Higher level expressions are evaluated before lower level expressions. Any level in the range 0 to Integer.MAX_VALUE is allowed. Negative values are reserved for system functions (printing and layouting).

        Specified by:
        setDependencyLevel in interface Expression
        Overrides:
        setDependencyLevel in class AbstractExpression
        Parameters:
        level - the level (must be greater than or equal to 0).
      • setRuntime

        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.

        Specified by:
        setRuntime in interface Expression
        Overrides:
        setRuntime in class AbstractExpression
        Parameters:
        runtime - the runtime information for the expression