org.pentaho.reporting.engine.classic.core.states.process
Class ProcessState

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.states.process.ProcessState
All Implemented Interfaces:
Cloneable, ReportState

public class ProcessState
extends Object
implements ReportState


Field Summary
static int ARTIFICIAL_EVENT_CODE
           
 
Fields inherited from interface org.pentaho.reporting.engine.classic.core.states.ReportState
BEFORE_FIRST_GROUP, BEFORE_FIRST_ROW
 
Constructor Summary
ProcessState()
           
 
Method Summary
 ProcessState advance()
           
 Object clone()
           
 ProcessState commit()
           
 GroupingState createGroupingState()
           
 ProcessState deriveForAdvance()
           
 ProcessState deriveForPagebreak()
          This is a more expensive version of the ordinary derive.
 ProcessState deriveForStorage()
           
 void enterGroup()
           
 void enterPresentationGroup()
           
 void firePageFinishedEvent(boolean noParentPassing)
          Fires a 'page-finished' event.
 void firePageStartedEvent(int baseEvent)
          Fires a 'page-started' event.
 AdvanceHandler getAdvanceHandler()
           
 int getCurrentCrosstabPaddingItem()
           
 int getCurrentDataItem()
           
 int getCurrentGroupIndex()
           
 int getCurrentSubReport()
           
 InlineSubreportMarker getCurrentSubReportMarker()
           
 DataRow getDataRow()
           
 ReportProcessingErrorHandler getErrorHandler()
           
 int getEventCode()
          Returns the unique event code for this report state type.
 DefaultFlowController getFlowController()
           
 FunctionStorage getFunctionStorage()
           
 LayoutProcess getLayoutProcess()
           
 int getLevel()
           
 int getNumberOfRows()
           
 ReportState getParentState()
           
 ReportState getParentSubReportState()
           
 int getPresentationGroupIndex()
           
 ProcessStateHandle getProcessHandle()
           
 ReportStateKey getProcessKey()
           
 int getProgressLevel()
           
 int getProgressLevelCount()
           
 ReportDefinition getReport()
           
 int[] getRequiredRuntimeLevels()
           
 ResourceBundleFactory getResourceBundleFactory()
           
 int getSequenceCounter()
           
 FunctionStorage getStructureFunctionStorage()
           
 SubReportProcessType getSubreportProcessingType()
           
 InlineSubreportMarker[] getSubReports()
           
 void initializeForMasterReport(MasterReport report, ProcessingContext processingContext, InitialLayoutProcess layoutProcess)
           
 void initializeForSubreport(InlineSubreportMarker[] subReports, int subReportIndex, ProcessState parentState)
           
 boolean isArtifcialState()
           
 boolean isFinish()
           
 boolean isInItemGroup()
           
 boolean isInlineProcess()
           
static boolean isLastItemInGroup(Group rootGroup, MasterDataRow currentDataRow, MasterDataRow nextDataRow)
          Returns true if this is the last item in the group, and false otherwise.
 boolean isPrepareRun()
           
 boolean isStructuralPreprocessingNeeded()
           
 boolean isSubReportEvent()
           
 boolean isSubReportExecutable()
           
 void leaveGroup()
           
 void leavePresentationGroup()
           
 ProcessState restart()
           
 ProcessState returnFromSubReport(LayoutProcess layoutProcess)
           
 void setAdvanceHandler(AdvanceHandler advanceHandler)
           
 void setCurrentSubReport(int currentSubReport)
           
 void setErrorHandler(ReportProcessingErrorHandler errorHandler)
           
 void setFlowController(DefaultFlowController flowController)
           
 void setInItemGroup(boolean inItemGroup)
           
 void setSequenceCounter(int sequenceCounter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARTIFICIAL_EVENT_CODE

public static final int ARTIFICIAL_EVENT_CODE
See Also:
Constant Field Values
Constructor Detail

ProcessState

public ProcessState()
Method Detail

initializeForMasterReport

public void initializeForMasterReport(MasterReport report,
                                      ProcessingContext processingContext,
                                      InitialLayoutProcess layoutProcess)
                               throws ReportProcessingException
Throws:
ReportProcessingException

initializeForSubreport

public void initializeForSubreport(InlineSubreportMarker[] subReports,
                                   int subReportIndex,
                                   ProcessState parentState)
                            throws ReportProcessingException
Throws:
ReportProcessingException

getRequiredRuntimeLevels

public int[] getRequiredRuntimeLevels()

isSubReportExecutable

public boolean isSubReportExecutable()

returnFromSubReport

public ProcessState returnFromSubReport(LayoutProcess layoutProcess)
                                 throws ReportProcessingException
Throws:
ReportProcessingException

restart

public ProcessState restart()
                     throws ReportProcessingException
Throws:
ReportProcessingException

getErrorHandler

public ReportProcessingErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface ReportState

setErrorHandler

public void setErrorHandler(ReportProcessingErrorHandler errorHandler)
Specified by:
setErrorHandler in interface ReportState

setSequenceCounter

public void setSequenceCounter(int sequenceCounter)

getSequenceCounter

public int getSequenceCounter()

getCurrentSubReportMarker

public InlineSubreportMarker getCurrentSubReportMarker()
Specified by:
getCurrentSubReportMarker in interface ReportState

isInlineProcess

public boolean isInlineProcess()
Specified by:
isInlineProcess in interface ReportState

getSubreportProcessingType

public SubReportProcessType getSubreportProcessingType()

deriveForPagebreak

public ProcessState deriveForPagebreak()
This is a more expensive version of the ordinary derive. This method creates a separate copy of the layout-process so that this operation is expensive in memory and CPU usage.

Returns:
the derived state.

deriveForAdvance

public ProcessState deriveForAdvance()

deriveForStorage

public ProcessState deriveForStorage()

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface ReportState
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getAdvanceHandler

public AdvanceHandler getAdvanceHandler()

setAdvanceHandler

public void setAdvanceHandler(AdvanceHandler advanceHandler)

advance

public final ProcessState advance()
                           throws ReportProcessingException
Throws:
ReportProcessingException

commit

public final ProcessState commit()
                          throws ReportProcessingException
Throws:
ReportProcessingException

getCurrentDataItem

public int getCurrentDataItem()
Specified by:
getCurrentDataItem in interface ReportState

getCurrentCrosstabPaddingItem

public int getCurrentCrosstabPaddingItem()
Specified by:
getCurrentCrosstabPaddingItem in interface ReportState

getProgressLevel

public int getProgressLevel()
Specified by:
getProgressLevel in interface ReportState

getProgressLevelCount

public int getProgressLevelCount()
Specified by:
getProgressLevelCount in interface ReportState

isPrepareRun

public boolean isPrepareRun()
Specified by:
isPrepareRun in interface ReportState

getLevel

public int getLevel()
Specified by:
getLevel in interface ReportState

isFinish

public boolean isFinish()
Specified by:
isFinish in interface ReportState

getEventCode

public int getEventCode()
Description copied from interface: ReportState
Returns the unique event code for this report state type.

Specified by:
getEventCode in interface ReportState
Returns:
the event code for this state type.

getCurrentGroupIndex

public int getCurrentGroupIndex()
Specified by:
getCurrentGroupIndex in interface ReportState

enterGroup

public void enterGroup()

leaveGroup

public void leaveGroup()

getPresentationGroupIndex

public int getPresentationGroupIndex()
Specified by:
getPresentationGroupIndex in interface ReportState

enterPresentationGroup

public void enterPresentationGroup()

leavePresentationGroup

public void leavePresentationGroup()

getReport

public ReportDefinition getReport()
Specified by:
getReport in interface ReportState

getCurrentSubReport

public int getCurrentSubReport()

setCurrentSubReport

public void setCurrentSubReport(int currentSubReport)

getParentState

public ReportState getParentState()
Specified by:
getParentState in interface ReportState

getParentSubReportState

public ReportState getParentSubReportState()
Specified by:
getParentSubReportState in interface ReportState

getStructureFunctionStorage

public FunctionStorage getStructureFunctionStorage()

getFunctionStorage

public FunctionStorage getFunctionStorage()

getFlowController

public DefaultFlowController getFlowController()
Specified by:
getFlowController in interface ReportState

setFlowController

public void setFlowController(DefaultFlowController flowController)

getLayoutProcess

public LayoutProcess getLayoutProcess()
Specified by:
getLayoutProcess in interface ReportState

getProcessKey

public ReportStateKey getProcessKey()
Specified by:
getProcessKey in interface ReportState

getDataRow

public DataRow getDataRow()
Specified by:
getDataRow in interface ReportState

getNumberOfRows

public int getNumberOfRows()
Specified by:
getNumberOfRows in interface ReportState

firePageStartedEvent

public void firePageStartedEvent(int baseEvent)
Fires a 'page-started' event.

Specified by:
firePageStartedEvent in interface ReportState
Parameters:
baseEvent - the type of the base event which caused the page start to be triggered.

firePageFinishedEvent

public void firePageFinishedEvent(boolean noParentPassing)
Fires a 'page-finished' event. The pageFinished(...) method is called for every report function.

Specified by:
firePageFinishedEvent in interface ReportState

isLastItemInGroup

public static boolean isLastItemInGroup(Group rootGroup,
                                        MasterDataRow currentDataRow,
                                        MasterDataRow nextDataRow)
Returns true if this is the last item in the group, and false otherwise. This checks the group condition and all conditions of all subgroups.

Parameters:
rootGroup - the root group that should be checked.
currentDataRow - the current data row.
nextDataRow - the next data row, or null, if this is the last datarow.
Returns:
A flag indicating whether or not the current item is the last in its group.

isSubReportEvent

public boolean isSubReportEvent()
Specified by:
isSubReportEvent in interface ReportState

getSubReports

public InlineSubreportMarker[] getSubReports()

getProcessHandle

public ProcessStateHandle getProcessHandle()

setInItemGroup

public void setInItemGroup(boolean inItemGroup)

isInItemGroup

public boolean isInItemGroup()
Specified by:
isInItemGroup in interface ReportState

getResourceBundleFactory

public ResourceBundleFactory getResourceBundleFactory()
Specified by:
getResourceBundleFactory in interface ReportState

isArtifcialState

public boolean isArtifcialState()

createGroupingState

public GroupingState createGroupingState()
Specified by:
createGroupingState in interface ReportState

isStructuralPreprocessingNeeded

public boolean isStructuralPreprocessingNeeded()