Class DefaultPageStateList
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.layout.output.DefaultPageStateList
-
- All Implemented Interfaces:
PageStateList
public class DefaultPageStateList extends Object implements PageStateList
The ReportState list stores a report states for the beginning of every page. The list is filled on repagination and read when a report or a page of the report is printed. Important: This list stores page start report states, not arbitary report states. These ReportStates are special: they can be reproduced by calling processPage on the report. Internally this list is organized as a list of WeakReferenceLists, where every WeakReferenceList stores a certain number of page states. The first 20 states are stored in an ordinary list with strong-references, so these states never get GarbageCollected (and so they must never be restored by reprocessing them). The next 100 states are stored in 4-element ReferenceLists, so if a reference is lost, only 4 states have to be reprocessed. All other states are stored in 10-element lists.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description DefaultPageStateList(ReportProcessor proc)
Creates a new reportstatelist.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(PageState pageState)
Adds this report state to the end of the list.void
clear()
Removes all elements in the list.PageState
get(int index)
Retrieves the element on positionindex
in this list.protected ReportProcessor
getPageProcess()
protected void
set(int index, org.pentaho.reporting.engine.classic.core.layout.output.DefaultPageStateList.InternalStorageState state)
int
size()
Returns the number of elements in this list.
-
-
-
Constructor Detail
-
DefaultPageStateList
public DefaultPageStateList(ReportProcessor proc)
Creates a new reportstatelist. The list will be filled using the specified report and output target. Filling of the list is done elsewhere.- Parameters:
proc
- the reportprocessor used to restore lost states (null not permitted).- Throws:
NullPointerException
- if the report processor isnull
.
-
-
Method Detail
-
getPageProcess
protected ReportProcessor getPageProcess()
-
size
public int size()
Returns the number of elements in this list.- Specified by:
size
in interfacePageStateList
- Returns:
- the number of elements in the list.
-
add
public void add(PageState pageState)
Adds this report state to the end of the list.- Specified by:
add
in interfacePageStateList
- Parameters:
pageState
- the report state.
-
set
protected void set(int index, org.pentaho.reporting.engine.classic.core.layout.output.DefaultPageStateList.InternalStorageState state)
-
clear
public void clear()
Removes all elements in the list.- Specified by:
clear
in interfacePageStateList
-
get
public PageState get(int index)
Retrieves the element on positionindex
in this list.- Specified by:
get
in interfacePageStateList
- Parameters:
index
- the index.- Returns:
- the report state.
-
-