Class CrosstabCellBody
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.Element
-
- org.pentaho.reporting.engine.classic.core.Section
-
- org.pentaho.reporting.engine.classic.core.GroupBody
-
- org.pentaho.reporting.engine.classic.core.CrosstabCellBody
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Element>
,DataTarget
,ReportElement
public class CrosstabCellBody extends GroupBody
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
-
-
Constructor Summary
Constructors Constructor Description CrosstabCellBody()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addElement(int position, CrosstabCell element)
Adds a report element to the band.void
addElement(CrosstabCell element)
Adds a report element to the band.void
clear()
CrosstabCellBody
clone()
Clones this band and all elements contained in this band.CrosstabCellBody
derive(boolean preserveElementInstanceIds)
Creates a deep copy of this element and regenerates all instance-ids.CrosstabCell
findElement(String rowKeys, String colKeys)
Returns the matching crosstab-cell for the given key set.Element
getElement(int index)
Returns the element stored add the given index.int
getElementCount()
Returns the number of elements in this band.Group
getGroup()
DetailsHeader
getHeader()
Returns the group header.void
removeElement(Element e)
Removes an element from the band.void
setElementAt(int position, Element element)
void
setHeader(DetailsHeader header)
Sets the header for the group.String
toString()
Returns a string representation of the band, useful mainly for debugging purposes.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.Section
getDefaultStyleSheet, iterator, registerAsChild, unregisterAsChild, unregisterParent, validateLooping
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.Element
copyAttributes, copyInto, derive, getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeExpressions, getAttributeNames, getAttributeNamespaces, getAttributes, getAttributeTyped, getChangeTracker, getChildElementByType, getChildElementsByName, getChildElementsByType, getComputedStyle, getContentBase, getDataSource, getDefinitionSource, getElementContext, getElementType, getElementTypeName, getFirstAttribute, getHRefTarget, getId, getMasterReport, getMetaData, getName, getObjectID, getParent, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, isDynamicContent, isVisible, notifyElement, notifyNodeChildAdded, notifyNodeChildRemoved, notifyNodePropertiesChanged, notifyNodePropertiesChanged, notifyNodeStructureChanged, setAttribute, setAttribute, setAttributeExpression, setChangeTracker, setComputedStyle, setDataSource, setDynamicContent, setElementType, setHRefTarget, setId, setName, setParent, setStyleExpression, setVisible, updateChangedFlagInternal, updateInternalChangeFlag
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getHeader
public DetailsHeader getHeader()
Returns the group header.The group header is a report band that contains elements that should be printed at the start of a group.
- Returns:
- the group header.
-
setHeader
public void setHeader(DetailsHeader header)
Sets the header for the group.- Parameters:
header
- the header (null not permitted).- Throws:
NullPointerException
- if the given header is null
-
addElement
public void addElement(CrosstabCell element)
Adds a report element to the band.- Parameters:
element
- the element that should be added- Throws:
NullPointerException
- if the given element is nullIllegalArgumentException
- if the position is invalid, either negative or greater than the number of elements in this band or if the given element is a parent of this element.
-
addElement
public void addElement(int position, CrosstabCell element)
Adds a report element to the band. The element will be inserted at the specified position.- Parameters:
position
- the position where to insert the elementelement
- the element that should be added- Throws:
NullPointerException
- if the given element is nullIllegalArgumentException
- if the position is invalid, either negative or greater than the number of elements in this band or if the given element is a parent of this element.
-
findElement
public CrosstabCell findElement(String rowKeys, String colKeys)
Returns the matching crosstab-cell for the given key set. When searching a detail cell, give an empty set. When searching for a column-summary cell, give the column group field. Same for row-summary-cells. For total cells, give both the column and row field.- Parameters:
rowKeys
- the known row-keys for the lookup.colKeys
- the known col-keys for the lookup.- Returns:
- the first element with the specified name, or
null
if there is no such element. - Throws:
NullPointerException
- if the given name is null.
-
removeElement
public void removeElement(Element e)
Removes an element from the band.- Specified by:
removeElement
in classSection
- Parameters:
e
- the element to be removed.- Throws:
NullPointerException
- if the given element is null.
-
setElementAt
public void setElementAt(int position, Element element)
- Specified by:
setElementAt
in classSection
-
clear
public void clear()
-
getElementCount
public int getElementCount()
Returns the number of elements in this band.- Specified by:
getElementCount
in classSection
- Returns:
- the number of elements of this band.
-
getElement
public Element getElement(int index)
Returns the element stored add the given index.- Specified by:
getElement
in classSection
- Parameters:
index
- the element position within this band- Returns:
- the element
- Throws:
IndexOutOfBoundsException
- if the index is invalid.
-
toString
public String toString()
Returns a string representation of the band, useful mainly for debugging purposes.
-
clone
public CrosstabCellBody clone()
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 interfaceDataTarget
- Overrides:
clone
in classSection
- Returns:
- the clone of this band.
-
derive
public CrosstabCellBody derive(boolean preserveElementInstanceIds)
Creates a deep copy of this element and regenerates all instance-ids.- Overrides:
derive
in classSection
- 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.
-
-