org.jfree.report.function
Class AbstractFunction

java.lang.Object
  |
  +--org.jfree.report.function.AbstractExpression
        |
        +--org.jfree.report.function.AbstractFunction
Direct Known Subclasses:
AbstractElementFormatFunction, CountDistinctFunction, CreateGroupAnchorsFunction, CSVWriter, ElementVisibilitySwitchFunction, EventMonitorFunction, GroupCountFunction, HideArticleDetailsFunction, HidePageBandForTableExportFunction, ImageRenderFunction, ItemAvgFunction, ItemCountFunction, ItemHideFunction, ItemMaxFunction, ItemMinFunction, ItemPercentageFunction, ItemSumFunction, NettoProfitFunction, PageFunction, PageLayouter, PaintComponentFunction, PaintDynamicComponentFunction, SelectCardFunction, TableWriter, TotalCalculationFunction, TotalGroupSumFunction, TotalGroupSumQuotientFunction, TotalItemCountFunction, TriggerComplexPageFooterFunction, TriggerNestedGroupFunction, TriggerPageFooterFunction, TriggerTypeFunction, XMLWriter

public abstract class AbstractFunction
extends AbstractExpression
implements Function, java.io.Serializable

Base class for implementing new report functions. Provides empty implementations of all the methods in the Function interface.

The function is initialized when it gets added to the report. The method initialize gets called to perform the required initializations. At this point, all function properties must have been set to a valid state and the function must be named. If the initialisation fails, a FunctionInitializeException is thrown and the function get not added to the report.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
protected AbstractFunction()
          Creates an unnamed function.
protected AbstractFunction(java.lang.String name)
          Creates an named function.
 
Method Summary
 java.lang.Object clone()
          Clones the function.
 void groupFinished(ReportEvent event)
          Receives notification that a group has finished.
 void groupStarted(ReportEvent event)
          Receives notification that a group has started.
 void itemsAdvanced(ReportEvent event)
          Receives notification that a row of data is being processed.
 void itemsFinished(ReportEvent event)
          Receives notification that a group of item bands has been completed.
 void itemsStarted(ReportEvent event)
          Receives notification that a group of item bands is about to be processed.
 void reportDone(ReportEvent event)
          Receives notification that report generation has completed, the report footer was printed, no more output is done.
 void reportFinished(ReportEvent event)
          Receives notification that the report has finished.
 void reportInitialized(ReportEvent event)
          Receives notification that report generation initializes the current run.
 void reportStarted(ReportEvent event)
          Receives notification that the report has started.
 
Methods inherited from class org.jfree.report.function.AbstractExpression
getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, setActive, setDependencyLevel, setName, setRuntime
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFunction

protected AbstractFunction()
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.

AbstractFunction

protected AbstractFunction(java.lang.String name)
Creates an named function.
Parameters:
name - the name of the function.
Method Detail

reportInitialized

public void reportInitialized(ReportEvent event)
Receives notification that report generation initializes the current run.

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

Parameters:
event - The event.

reportStarted

public void reportStarted(ReportEvent event)
Receives notification that the report has started.
Parameters:
event - the event.

reportFinished

public void reportFinished(ReportEvent event)
Receives notification that the report has finished.
Parameters:
event - the event.

groupStarted

public void groupStarted(ReportEvent event)
Receives notification that a group has started.
Parameters:
event - the event.

groupFinished

public void groupFinished(ReportEvent event)
Receives notification that a group has finished.
Parameters:
event - the event.

itemsAdvanced

public void itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed.
Parameters:
event - the event.

itemsStarted

public void itemsStarted(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.

Parameters:
event - The event.

itemsFinished

public void itemsFinished(ReportEvent event)
Receives notification that a group of item bands has been completed.

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

Parameters:
event - The event.

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.
Parameters:
event - The event.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the function.

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

Overrides:
clone in class AbstractExpression
Returns:
a clone of this function.
Throws:
java.lang.CloneNotSupportedException - this should never happen.