Class IndexNumberGeneratorFunction

  • All Implemented Interfaces:
    Serializable, Cloneable, EventListener, org.pentaho.reporting.engine.classic.core.event.ReportListener, org.pentaho.reporting.engine.classic.core.function.Expression, org.pentaho.reporting.engine.classic.core.function.Function
    Direct Known Subclasses:
    IndexTextGeneratorFunction

    public class IndexNumberGeneratorFunction
    extends org.pentaho.reporting.engine.classic.core.function.AbstractFunction
    A data-collector that collects table-of-contents items at group-starts. The function collects these items accross subreport boundaries.
    Author:
    Thomas Morgner.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Object clone()
      Clones the expression.
      int getDepth()  
      org.pentaho.reporting.engine.classic.core.function.Expression getInstance()
      Return a completly separated copy of this function.
      Object getValue()
      Return the current expression value.
      void groupFinished​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
      Receives notification that a group has finished.
      void groupStarted​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)  
      boolean isCollectDetails()  
      boolean isDeepTraversing()
      Checks whether this expression is a deep-traversing expression.
      void itemsAdvanced​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
      Receives notification that a row of data is being processed.
      void itemsFinished​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
      Receives notification that a group of item bands has been completed.
      void itemsStarted​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
      Receives notification that a group of item bands is about to be processed.
      void reportInitialized​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
      Receives notification that report generation initializes the current run.
      void reportStarted​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
      Receives notification that the report has started.
      void setCollectDetails​(boolean collectDetails)  
      void setDepth​(int depth)  
      • Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction

        reportDone, reportFinished, summaryRowSelection
      • Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression

        getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
      • Methods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression

        getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isPreserve, setDependencyLevel, setName, setRuntime
    • Constructor Detail

      • IndexNumberGeneratorFunction

        public IndexNumberGeneratorFunction()
        Creates an unnamed function. Make sure the name of the function is set using AbstractExpression.setName(java.lang.String) before the function is added to the report's function collection.
    • Method Detail

      • isCollectDetails

        public boolean isCollectDetails()
      • setCollectDetails

        public void setCollectDetails​(boolean collectDetails)
      • getDepth

        public int getDepth()
      • setDepth

        public void setDepth​(int depth)
      • reportInitialized

        public void reportInitialized​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
        Receives notification that report generation initializes the current run.

        The event carries a ReportState.Started state. Use this to initialize the report.

        Specified by:
        reportInitialized in interface org.pentaho.reporting.engine.classic.core.event.ReportListener
        Overrides:
        reportInitialized in class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
        Parameters:
        event - The event.
      • reportStarted

        public void reportStarted​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
        Receives notification that the report has started.
        Specified by:
        reportStarted in interface org.pentaho.reporting.engine.classic.core.event.ReportListener
        Overrides:
        reportStarted in class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
        Parameters:
        event - the event.
      • groupStarted

        public void groupStarted​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
        Specified by:
        groupStarted in interface org.pentaho.reporting.engine.classic.core.event.ReportListener
        Overrides:
        groupStarted in class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
      • itemsStarted

        public void itemsStarted​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
        Receives notification that a group of item bands is about to be processed.

        The next events will be itemsAdvanced events until the itemsFinished event is raised.

        Specified by:
        itemsStarted in interface org.pentaho.reporting.engine.classic.core.event.ReportListener
        Overrides:
        itemsStarted in class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
        Parameters:
        event - The event.
      • itemsAdvanced

        public void itemsAdvanced​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
        Receives notification that a row of data is being processed.
        Specified by:
        itemsAdvanced in interface org.pentaho.reporting.engine.classic.core.event.ReportListener
        Overrides:
        itemsAdvanced in class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
        Parameters:
        event - the event.
      • itemsFinished

        public void itemsFinished​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
        Receives notification that a group of item bands has been completed.

        The itemBand is finished, the report starts to close open groups.

        Specified by:
        itemsFinished in interface org.pentaho.reporting.engine.classic.core.event.ReportListener
        Overrides:
        itemsFinished in class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
        Parameters:
        event - The event.
      • groupFinished

        public void groupFinished​(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
        Receives notification that a group has finished.
        Specified by:
        groupFinished in interface org.pentaho.reporting.engine.classic.core.event.ReportListener
        Overrides:
        groupFinished in class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
        Parameters:
        event - the event.
      • getValue

        public Object getValue()
        Return the current expression value.

        The value depends (obviously) on the expression implementation.

        Returns:
        the value of the function.
      • clone

        public Object clone()
                     throws CloneNotSupportedException
        Clones the expression. The expression should be reinitialized after the cloning.

        Expressions maintain no state, cloning is done at the beginning of the report processing to disconnect the expression from any other object space.

        Specified by:
        clone in interface org.pentaho.reporting.engine.classic.core.function.Expression
        Overrides:
        clone in class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
        Returns:
        a clone of this expression.
        Throws:
        CloneNotSupportedException - this should never happen.
      • isDeepTraversing

        public boolean isDeepTraversing()
        Checks whether this expression is a deep-traversing expression. Deep-traversing expressions receive events from all sub-reports. This returns false by default, as ordinary expressions have no need to be deep-traversing.
        Specified by:
        isDeepTraversing in interface org.pentaho.reporting.engine.classic.core.function.Expression
        Overrides:
        isDeepTraversing in class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
        Returns:
        false.
      • getInstance

        public org.pentaho.reporting.engine.classic.core.function.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 org.pentaho.reporting.engine.classic.core.function.Expression
        Overrides:
        getInstance in class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
        Returns:
        a copy of this function.