Class RelationalGroup
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.Element
-
- org.pentaho.reporting.engine.classic.core.Section
-
- org.pentaho.reporting.engine.classic.core.Group
-
- org.pentaho.reporting.engine.classic.core.RelationalGroup
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Element>
,DataTarget
,ReportElement
public class RelationalGroup extends Group
A group that accepts fields.- Author:
- Thomas Morgner
- 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 RelationalGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addField(String name)
Adds a field to the group.void
clearFields()
RelationalGroup
clone()
Clones this Element.protected GroupBody
createDefaultBody()
RelationalGroup
derive(boolean preserveElementInstanceIds)
Creates a deep copy of this element and regenerates all instance-ids.boolean
equals(Object obj)
Checks whether the group is equal.GroupDataBody
findGroupDataBody()
Deprecated.Element
getElement(int index)
Returns the element stored add the given index.int
getElementCount()
Returns the number of elements in this section.List<String>
getFields()
Returns the list of fields for this group.String[]
getFieldsArray()
Returns the group fields as array.GroupFooter
getFooter()
Returns the group footer.GroupHeader
getHeader()
Returns the group header.List<SortConstraint>
getSortingConstraint()
int
hashCode()
Computes a hashcode for this group.boolean
isGroupChange(DataRow dataRow)
protected void
removeElement(Element element)
Removes an element from the section.void
setBody(GroupBody body)
void
setElementAt(int index, Element element)
void
setFields(List<String> c)
Sets the fields for this group.void
setFieldsArray(String[] fields)
void
setFooter(GroupFooter footer)
Sets the footer for the group.void
setHeader(GroupHeader header)
Sets the header for the group.String
toString()
Returns a string representation of the group (useful for debugging).-
Methods inherited from class org.pentaho.reporting.engine.classic.core.Group
getBody, getGeneratedName, getName, isAscendingSortOrder, mapFields, matches, notifyElement, setAscendingSortOrder
-
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, getObjectID, getParent, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, isDynamicContent, isVisible, 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
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getHeader
public GroupHeader 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(GroupHeader header)
Sets the header for the group.- Parameters:
header
- the header (null not permitted).- Throws:
NullPointerException
- if the given header is null
-
getFooter
public GroupFooter getFooter()
Returns the group footer.- Returns:
- the footer.
-
setFooter
public void setFooter(GroupFooter footer)
Sets the footer for the group.- Parameters:
footer
- the footer (null not permitted).- Throws:
NullPointerException
- if the given footer is null.
-
setFields
public void setFields(List<String> c)
Sets the fields for this group. The given list must contain Strings defining the needed fields from the DataRow. Don't reference Function-Fields here, functions are not supported in th groupfield definition.- Parameters:
c
- the list containing strings.- Throws:
NullPointerException
- if the given list is null or the list contains null-values.
-
clearFields
public void clearFields()
-
createDefaultBody
protected GroupBody createDefaultBody()
- Specified by:
createDefaultBody
in classGroup
-
getElementCount
public int getElementCount()
Description copied from class:Section
Returns the number of elements in this section.- Specified by:
getElementCount
in classSection
- Returns:
- the number of elements of this section.
-
addField
public void addField(String name)
Adds a field to the group. The field names must correspond to the column names in the report's TableModel.- Parameters:
name
- the field name (null not permitted).- Throws:
NullPointerException
- if the name is null
-
getFields
public List<String> getFields()
Returns the list of fields for this group.- Returns:
- a list (unmodifiable) of fields for the group.
-
setFieldsArray
public void setFieldsArray(String[] fields)
-
getFieldsArray
public String[] getFieldsArray()
Returns the group fields as array.- Returns:
- the fields as string array.
-
toString
public String toString()
Returns a string representation of the group (useful for debugging).
-
equals
public boolean equals(Object obj)
Checks whether the group is equal. A group is considered equal to another group, if it defines the same fields as the other group.
-
hashCode
public int hashCode()
Computes a hashcode for this group.
-
isGroupChange
public boolean isGroupChange(DataRow dataRow)
- Specified by:
isGroupChange
in classGroup
-
findGroupDataBody
@Deprecated public GroupDataBody findGroupDataBody()
Deprecated.
-
clone
public RelationalGroup clone()
Clones this Element.- Specified by:
clone
in interfaceDataTarget
- Overrides:
clone
in classGroup
- Returns:
- a clone of this element.
-
derive
public RelationalGroup derive(boolean preserveElementInstanceIds)
Description copied from class:Element
Creates a deep copy of this element and regenerates all instance-ids.- Overrides:
derive
in classGroup
- 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.
-
removeElement
protected void removeElement(Element element)
Description copied from class:Section
Removes an element from the section.- Overrides:
removeElement
in classGroup
- Parameters:
element
- the element to be section.
-
getElement
public Element getElement(int index)
Description copied from class:Section
Returns the element stored add the given index.- Specified by:
getElement
in classSection
- Parameters:
index
- the element position within this section- Returns:
- the element
-
setElementAt
public void setElementAt(int index, Element element)
- Specified by:
setElementAt
in classSection
-
getSortingConstraint
public List<SortConstraint> getSortingConstraint()
- Specified by:
getSortingConstraint
in classGroup
-
-