Class ProcessState
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.states.process.ProcessState
-
- All Implemented Interfaces:
Cloneable
,ReportState
public class ProcessState extends Object implements ReportState
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description ProcessState()
-
Method Summary
-
-
-
Field Detail
-
ARTIFICIAL_EVENT_CODE
public static final int ARTIFICIAL_EVENT_CODE
- See Also:
- Constant Field Values
-
-
Method Detail
-
initializeForMasterReport
public boolean initializeForMasterReport(MasterReport report, ProcessingContext processingContext, OutputFunction outputFunction) throws ReportProcessingException
- Throws:
ReportProcessingException
-
initializeForSubreport
public void initializeForSubreport(InlineSubreportMarker[] subReports, int subReportIndex, ProcessState parentState) throws ReportProcessingException
- Throws:
ReportProcessingException
-
getProcessStore
public ReportProcessStore getProcessStore()
- Specified by:
getProcessStore
in interfaceReportState
-
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 interfaceReportState
-
setErrorHandler
public void setErrorHandler(ReportProcessingErrorHandler errorHandler)
- Specified by:
setErrorHandler
in interfaceReportState
-
setSequenceCounter
public void setSequenceCounter(int sequenceCounter)
-
getSequenceCounter
public int getSequenceCounter()
-
getCurrentSubReportMarker
public InlineSubreportMarker getCurrentSubReportMarker()
- Specified by:
getCurrentSubReportMarker
in interfaceReportState
-
isInlineProcess
public boolean isInlineProcess()
- Specified by:
isInlineProcess
in interfaceReportState
-
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 ProcessState clone() throws CloneNotSupportedException
- Specified by:
clone
in interfaceReportState
- Overrides:
clone
in classObject
- 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
-
getCurrentRow
public int getCurrentRow()
Description copied from interface:ReportState
Returns the currently processed row number. This row number contains padded rows and is equivalent to the number of advance() calls made on the master-datarow.- Specified by:
getCurrentRow
in interfaceReportState
- Returns:
- the current row number.
-
getCurrentDataItem
public int getCurrentDataItem()
Description copied from interface:ReportState
Returns the current data item. The data item is the row number used to access the raw data in the tablemodel. This number is not guaranteed to increase sequentially as sorting may affect the order of rows.- Specified by:
getCurrentDataItem
in interfaceReportState
- Returns:
- the current raw access row number.
-
getProgressLevel
public int getProgressLevel()
- Specified by:
getProgressLevel
in interfaceReportState
-
getProgressLevelCount
public int getProgressLevelCount()
- Specified by:
getProgressLevelCount
in interfaceReportState
-
isPrepareRun
public boolean isPrepareRun()
- Specified by:
isPrepareRun
in interfaceReportState
-
getLevel
public int getLevel()
- Specified by:
getLevel
in interfaceReportState
-
isFinish
public boolean isFinish()
- Specified by:
isFinish
in interfaceReportState
-
getEventCode
public int getEventCode()
Description copied from interface:ReportState
Returns the unique event code for this report state type.- Specified by:
getEventCode
in interfaceReportState
- Returns:
- the event code for this state type.
-
getCurrentGroupIndex
public int getCurrentGroupIndex()
- Specified by:
getCurrentGroupIndex
in interfaceReportState
-
enterGroup
public void enterGroup()
-
leaveGroup
public void leaveGroup()
-
getPresentationGroupIndex
public int getPresentationGroupIndex()
- Specified by:
getPresentationGroupIndex
in interfaceReportState
-
enterPresentationGroup
public void enterPresentationGroup()
-
leavePresentationGroup
public void leavePresentationGroup()
-
getReport
public ReportDefinition getReport()
- Specified by:
getReport
in interfaceReportState
-
getCurrentSubReport
public int getCurrentSubReport()
-
getParentState
public ReportState getParentState()
- Specified by:
getParentState
in interfaceReportState
-
getParentSubReportState
public ReportState getParentSubReportState()
- Specified by:
getParentSubReportState
in interfaceReportState
-
getStructureFunctionStorage
public FunctionStorage getStructureFunctionStorage()
-
getFunctionStorage
public FunctionStorage getFunctionStorage()
-
getFlowController
public DefaultFlowController getFlowController()
- Specified by:
getFlowController
in interfaceReportState
-
setFlowController
public void setFlowController(DefaultFlowController flowController)
-
getLayoutProcess
public LayoutProcess getLayoutProcess()
- Specified by:
getLayoutProcess
in interfaceReportState
-
getProcessKey
public ReportStateKey getProcessKey()
- Specified by:
getProcessKey
in interfaceReportState
-
getDataRow
public DataRow getDataRow()
- Specified by:
getDataRow
in interfaceReportState
-
getNumberOfRows
public int getNumberOfRows()
- Specified by:
getNumberOfRows
in interfaceReportState
-
firePageStartedEvent
public void firePageStartedEvent(int baseEvent)
Fires a 'page-started' event.- Specified by:
firePageStartedEvent
in interfaceReportState
- 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. ThepageFinished(...)
method is called for every report function.- Specified by:
firePageFinishedEvent
in interfaceReportState
-
fireReportEvent
protected void fireReportEvent()
-
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 interfaceReportState
-
getSubReports
public InlineSubreportMarker[] getSubReports()
-
getProcessHandle
public ProcessStateHandle getProcessHandle()
-
setInItemGroup
public void setInItemGroup(boolean inItemGroup)
-
isInItemGroup
public boolean isInItemGroup()
- Specified by:
isInItemGroup
in interfaceReportState
-
getResourceBundleFactory
public ResourceBundleFactory getResourceBundleFactory()
- Specified by:
getResourceBundleFactory
in interfaceReportState
-
isArtifcialState
public boolean isArtifcialState()
-
createGroupingState
public GroupingState createGroupingState()
- Specified by:
createGroupingState
in interfaceReportState
-
isStructuralPreprocessingNeeded
public boolean isStructuralPreprocessingNeeded()
- Specified by:
isStructuralPreprocessingNeeded
in interfaceReportState
-
advanceCursor
public void advanceCursor()
-
getPredictedStateCount
public Integer getPredictedStateCount()
- Specified by:
getPredictedStateCount
in interfaceReportState
-
isCrosstabActive
public boolean isCrosstabActive()
- Specified by:
isCrosstabActive
in interfaceReportState
-
recordCrosstabRowState
public ProcessState recordCrosstabRowState()
-
replayStoredCrosstabRowState
public ProcessState replayStoredCrosstabRowState()
Reset the state to use the stored flow-controller for the summary calculation.- Returns:
-
getReplayStoredCrosstabGroup
public int getReplayStoredCrosstabGroup()
-
getPostSummaryRowAdvanceHandler
public AdvanceHandler getPostSummaryRowAdvanceHandler()
-
setPostSummaryRowAdvanceHandler
public void setPostSummaryRowAdvanceHandler(AdvanceHandler postSummaryRowAdvanceHandler)
-
finishReplayingStoredCrosstabRowState
public ProcessState finishReplayingStoredCrosstabRowState() throws ReportProcessingException
- Throws:
ReportProcessingException
-
clearStoredCrosstabRowState
public void clearStoredCrosstabRowState()
-
getGroupSequenceCounter
public long getGroupSequenceCounter(int groupIndex)
- Specified by:
getGroupSequenceCounter
in interfaceReportState
-
getCrosstabColumnSequenceCounter
public long getCrosstabColumnSequenceCounter(int groupIndex)
- Specified by:
getCrosstabColumnSequenceCounter
in interfaceReportState
-
crosstabResetColumnIndices
public void crosstabResetColumnIndices()
-
crosstabIncrementColumnCounter
public void crosstabIncrementColumnCounter()
-
getPerformanceMonitorContext
public PerformanceMonitorContext getPerformanceMonitorContext()
- Specified by:
getPerformanceMonitorContext
in interfaceReportState
-
-