org.pentaho.reporting.engine.classic.core
Class AbstractRootLevelBand

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.Element
      extended by org.pentaho.reporting.engine.classic.core.Section
          extended by org.pentaho.reporting.engine.classic.core.Band
              extended by org.pentaho.reporting.engine.classic.core.AbstractRootLevelBand
All Implemented Interfaces:
Serializable, Cloneable, DataTarget, ReportElement, RootLevelBand
Direct Known Subclasses:
GroupFooter, GroupHeader, ItemBand, NoDataBand, ReportFooter, ReportHeader

public abstract class AbstractRootLevelBand
extends Band
implements RootLevelBand

The root-level band is the container that is processed by a report-state. The root-level band processing is atomic - so either the full band is processed or not processed at all.

Author:
Thomas Morgner
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.Band
ANONYMOUS_BAND_PREFIX, CONTENT_TYPE
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
 
Method Summary
 void addSubReport(int index, SubReport element)
          Attaches a new subreport at the end of the list.
 void addSubReport(SubReport element)
          Attaches a new subreport at the end of the list.
 Object clone()
          Clones this band and all elements contained in this band.
 Element derive(boolean preserveElementInstanceIds)
          Creates a deep copy of this element and regenerates all instance-ids.
 SubReport getSubReport(int index)
          Returns the subreport at the given index-position.
 int getSubReportCount()
          Returns the number of subreports attached to this root level band.
 SubReport[] getSubReports()
          Returns all sub-reports as array.
 void removeSubreport(SubReport e)
          Removes the given subreport from the list of attached sub-reports.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.Band
addElement, addElement, addElements, clear, getElement, getElement, getElementArray, getElementCount, isPagebreakAfterPrint, isPagebreakBeforePrint, removeElement, setElementAt, setPagebreakAfterPrint, setPagebreakBeforePrint, toString, unsafeGetElementArray
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.Element
derive, getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getChangeTracker, getContentBase, getDataSource, getDefinitionSource, getElementType, getElementTypeName, getHRefTarget, getId, getMetaData, getName, getObjectID, getParent, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, getValue, isDynamicContent, isVisible, notifyNodeChildAdded, notifyNodeChildRemoved, notifyNodePropertiesChanged, notifyNodePropertiesChanged, notifyNodeStructureChanged, setAttribute, setAttribute, setAttributeExpression, setDataSource, setDynamicContent, setElementType, setHRefTarget, setId, setName, setStyleExpression, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pentaho.reporting.engine.classic.core.ReportElement
getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getId, getMetaData, getName, getObjectID, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, setAttribute, setAttributeExpression, setStyleExpression
 

Method Detail

getSubReportCount

public int getSubReportCount()
Returns the number of subreports attached to this root level band.

Specified by:
getSubReportCount in interface RootLevelBand
Returns:
the number of subreports.

clone

public Object clone()
             throws CloneNotSupportedException
Clones this band and all elements contained in this band. After the cloning the band is no longer connected to a report definition.

Specified by:
clone in interface DataTarget
Overrides:
clone in class Band
Returns:
the clone of this band.
Throws:
CloneNotSupportedException - if this band or an element contained in this band does not support cloning.

derive

public Element derive(boolean preserveElementInstanceIds)
               throws CloneNotSupportedException
Creates a deep copy of this element and regenerates all instance-ids.

Overrides:
derive in class Band
Parameters:
preserveElementInstanceIds - defines whether this call generates new instance-ids for the derived elements. Instance-IDs are used by the report processor to recognize reoccurring elements and must not changed within the report run. Outside of the report processors new instance ids should be generated at all times to separate instances and to make them uniquely identifiable.
Returns:
the copy of the element.
Throws:
CloneNotSupportedException - if there was an error while cloning this or any child object.

getSubReport

public SubReport getSubReport(int index)
Returns the subreport at the given index-position.

Specified by:
getSubReport in interface RootLevelBand
Parameters:
index - the index
Returns:
the subreport stored at the given index.
Throws:
IndexOutOfBoundsException - if there is no such subreport.

addSubReport

public void addSubReport(int index,
                         SubReport element)
Attaches a new subreport at the end of the list.

Parameters:
index -
element - the subreport, never null.

addSubReport

public void addSubReport(SubReport element)
Attaches a new subreport at the end of the list.

Parameters:
element - the subreport, never null.

removeSubreport

public void removeSubreport(SubReport e)
Removes the given subreport from the list of attached sub-reports.

Parameters:
e - the subreport to be removed.

getSubReports

public SubReport[] getSubReports()
Returns all sub-reports as array.

Specified by:
getSubReports in interface RootLevelBand
Returns:
the sub-reports as array.