Class PageOfPagesFunction

    • Constructor Detail

      • PageOfPagesFunction

        public PageOfPagesFunction()
        Default Constructor.
      • PageOfPagesFunction

        public PageOfPagesFunction​(String name)
        Constructs a named function.
        Parameters:
        name - the function name.
    • Method Detail

      • getFormat

        public String getFormat()
        Returns the format used to print the value. The default format is "{0} / {1}".
        Returns:
        the format string.
        See Also:
        MessageFormat
      • setFormat

        public void setFormat​(String format)
        Set the format of the value. The format should follow the rules of MessageFormat. The first parameter is filled with the current page, the second with the total number of pages.
        Parameters:
        format - the format string.
      • reportDone

        public void reportDone​(ReportEvent event)
        Receives notification that report generation has completed, the report footer was printed, no more output is done. This is a helper event to shut down the output service.
        Specified by:
        reportDone in interface ReportListener
        Overrides:
        reportDone in class AbstractFunction
        Parameters:
        event - The event.
      • getValue

        public Object getValue()
        Return the value of this Function. The method uses the format definition from the properties and adds the current page and the total number of pages as parameter.
        Specified by:
        getValue in interface Expression
        Overrides:
        getValue in class PageFunction
        Returns:
        the formatted value with current page and total number of pages.
      • setGroup

        public void setGroup​(String group)
        Sets the name of the group that the function acts upon.
        Overrides:
        setGroup in class PageFunction
        Parameters:
        group - the group name.
      • setStartPage

        public void setStartPage​(int startPage)
        Defines the page number where the counting starts.
        Overrides:
        setStartPage in class PageFunction
        Parameters:
        startPage - the page number of the first page.
      • setDependencyLevel

        public void setDependencyLevel​(int level)
        Defines the defined dependency level. For page functions, this level can be as low as the pagination level.
        Specified by:
        setDependencyLevel in interface Expression
        Overrides:
        setDependencyLevel in class PageFunction
        Parameters:
        level - the dependency level.
      • getDependencyLevel

        public int getDependencyLevel()
        Returns the defined dependency level. For page functions, this level can be as low as the pagination level.
        Specified by:
        getDependencyLevel in interface Expression
        Overrides:
        getDependencyLevel in class PageFunction
        Returns:
        the dependency level.
      • 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.
      • 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.
        Specified by:
        setRuntime in interface Expression
        Overrides:
        setRuntime in class AbstractExpression
        Parameters:
        runtime - the runtime information for the expression