| java.lang.Object org.jfree.report.Group
Group | public class Group implements Serializable,Cloneable,Comparable(Code) | | A report group. Reports can contain any number of (nested) groups. The order of the
fields is not important. If the group does not contain any fields, the group spans the
whole report from the first to the last row (such a group is called the default group).
The group's field list should not be modified after the group was added to the group
list, or the results are undefined.
Groups of the same GroupList must have a subgroup relation. The designated child group
must contain all fields of the direct parent plus at least one new field. There is no
requirement, that the referenced field actually exists, if it doesn't, null is assumed
as field value.
It is recommended that the name of the group is unique within the report. The name will
not be used internally to identify the group, but most functions depend on a
recognizable group name to identify the group to be processed.
author: David Gilbert author: Thomas Morgner See Also: GroupList |
Constructor Summary | |
public | Group() Constructs a group with no fields, and an empty header and footer. |
ANONYMOUS_GROUP_PREFIX | final public static String ANONYMOUS_GROUP_PREFIX(Code) | | The internal constant to mark anonymous group names.
|
Group | public Group()(Code) | | Constructs a group with no fields, and an empty header and footer.
|
addField | public void addField(String name)(Code) | | 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 |
compareTo | public int compareTo(Object o)(Code) | | Compares two objects (required to be instances of the Group class). The group's field
lists are compared, order of the fields does not matter.
Parameters: o - the to be compared object. an integer indicating the relative ordering of the two groups. |
equals | public boolean equals(Object obj)(Code) | | Checks, whether the group is equal. A group is considered equal to another group, if
it defines the same fields as the other group.
Parameters: obj - the object to be checked true, if the object is a group instance with the same fields, falseotherwise. |
getFields | public List getFields()(Code) | | Returns the list of fields for this group.
a list (unmodifiable) of fields for the group. |
getFieldsArray | public String[] getFieldsArray()(Code) | | Returns the group fields as array. The array must not be modified.
the fields as string array. |
getHeader | public GroupHeader getHeader()(Code) | | Returns the group header. The group header is a report band that contains
elements that should be printed at the start of a group.
the group header. |
getName | public String getName()(Code) | | Returns the name of the group. This will never be null.
the group name. |
getReportDefinition | public ReportDefinition getReportDefinition()(Code) | | Returns the assigned report definition of the group.
the report definition (maybe null). |
hashCode | public int hashCode()(Code) | | Computes a hashcode for this group.
the hashcode. |
setFields | public void setFields(List c)(Code) | | 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 containsnull-values. |
setFooter | public void setFooter(GroupFooter footer)(Code) | | Sets the footer for the group.
Parameters: footer - the footer (null not permitted). throws: NullPointerException - if the given footer is null. |
setHeader | public void setHeader(GroupHeader header)(Code) | | Sets the header for the group.
Parameters: header - the header (null not permitted). throws: NullPointerException - if the given header is null |
setName | public void setName(String name)(Code) | | Defines the name for this group. The name must not be null.
Parameters: name - the group name (null not permitted). |
setReportDefinition | public void setReportDefinition(ReportDefinition reportDefinition)(Code) | | Assigns the report definition to the group and all bands in that group.
Parameters: reportDefinition - the report definition (maybe null). |
toString | public String toString()(Code) | | Returns a string representation of the group (useful for debugging).
A string. |
|
|