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

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.Group
              extended by org.pentaho.reporting.engine.classic.core.RelationalGroup
All Implemented Interfaces:
Serializable, Cloneable, 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.Group
ANONYMOUS_GROUP_PREFIX
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
 
Constructor Summary
RelationalGroup()
           
 
Method Summary
 void addField(String name)
          Adds a field to the group.
 void clearFields()
           
 boolean equals(Object obj)
          Checks whether the group is equal.
 List getFields()
          Returns the list of fields for this group.
 String[] getFieldsArray()
          Returns the group fields as array.
 int hashCode()
          Computes a hashcode for this group.
 boolean isGroupChange(DataRow dataRow)
           
 void setBody(GroupBody body)
           
 void setFields(List c)
          Sets the fields for this group.
 void setFieldsArray(String[] fields)
           
 String toString()
          Returns a string representation of the group (useful for debugging).
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.Group
clone, derive, getBody, getElement, getElementCount, getFooter, getHeader, setElementAt, setFooter, setHeader
 
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
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationalGroup

public RelationalGroup()
Method Detail

setFields

public void setFields(List 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()

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 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).

Overrides:
toString in class Element
Returns:
A string.

setBody

public void setBody(GroupBody body)
Overrides:
setBody in class Group

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.

Overrides:
equals in class Object
Parameters:
obj - the object to be checked
Returns:
true, if the object is a group instance with the same fields, false otherwise.

hashCode

public int hashCode()
Computes a hashcode for this group.

Overrides:
hashCode in class Object
Returns:
the hashcode.

isGroupChange

public boolean isGroupChange(DataRow dataRow)
Specified by:
isGroupChange in class Group