KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > crosstabs > JRCrosstabGroup


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.crosstabs;
29
30 import net.sf.jasperreports.engine.JRVariable;
31
32
33 /**
34  * Base interface for crosstab row and column groups.
35  *
36  * @author Lucian Chirita (lucianc@users.sourceforge.net)
37  * @version $Id: JRCrosstabGroup.java 1229 2006-04-19 13:27:35 +0300 (Wed, 19 Apr 2006) teodord $
38  */

39 public interface JRCrosstabGroup
40 {
41     /**
42      * Returns the name of the group.
43      *
44      * @return the name of the group
45      * @see #getVariable()
46      */

47     public String JavaDoc getName();
48     
49     /**
50      * Returns the position of the total row/column for this group.
51      * <p>
52      * A group can have a total row/column summing the values for all the
53      * entries in the group. E.g. if there is a Year group having Month as
54      * a subgroup, the total row/column for the Year group would sum the values
55      * for all the years and the total row/column for the Month group would sum
56      * the values for all the months of an year.
57      * <p>
58      * Possible values for this attribute are:
59      * <ul>
60      * <li>{@link net.sf.jasperreports.crosstabs.fill.calculation.BucketDefinition#TOTAL_POSITION_NONE Bucket.TOTAL_POSITION_NONE}
61      * - the group will not display a total row/column</li>
62      * <li>{@link net.sf.jasperreports.crosstabs.fill.calculation.BucketDefinition#TOTAL_POSITION_START Bucket.TOTAL_POSITION_START}
63      * - the group will display the total row/column before the group rows/columns</li>
64      * <li>{@link net.sf.jasperreports.crosstabs.fill.calculation.BucketDefinition#TOTAL_POSITION_END Bucket.TOTAL_POSITION_END}
65      * - the group will display the total row/column at the end of the group rows/columns</li>
66      *
67      * @return the position of the total row/column for this group
68      */

69     public byte getTotalPosition();
70     
71     
72     /**
73      * Returns the bucketing information for this group.
74      * <p>
75      * The bucketing information consists of grouping expression and
76      * group ordering.
77      *
78      * @return the bucketing information for this group
79      */

80     public JRCrosstabBucket getBucket();
81     
82     
83     /**
84      * Returns the group header cell.
85      * <p>
86      * The size of the header cell is computed based on the following rules
87      * (only the row header rules are listed, the ones for columns can be
88      * deducted by simmetrical duality):
89      * <ul>
90      * <li>the width of the header is given by {@link JRCrosstabRowGroup#getWidth() JRCrosstabRowGroup.getWidth()}</li>
91      * <li>the height of the last row group header is given by the height of the base cell</li>
92      * <li>the height of a non-last row group header is the sum of the next group header's height and
93      * the next group total header's height (0 if the next group doesn't have a total header)</li>
94      * </ul>
95      * <p>
96      * Should never return null, but empty cell contents instead.
97      *
98      * @return the group header cell
99      */

100     public JRCellContents getHeader();
101     
102     
103     /**
104      * Returns the group total header cell.
105      * <p>
106      * The size of a row group total header is computed based on the following rules:
107      * <ul>
108      * <li>the width is the sum the widths of this and subsequent row groups</li>
109      * <li>the height is the height of the base cell for this total row</li>
110      * </ul>
111      * <p>
112      * Should never return null, but empty cell contents instead.
113      *
114      * @return the group total header cell
115      */

116     public JRCellContents getTotalHeader();
117     
118     
119     /**
120      * Returns the variable associated to this group.
121      * <p>
122      * Each group in the crosstab has a variable that can be used
123      * inside the group header as the current group value.
124      * The variable has the same name as the group and the same type
125      * as the bucket expression of the group.
126      *
127      * @return the variable associated to this group
128      */

129     public JRVariable getVariable();
130     
131     
132     /**
133      * Returns whether the group has a total row/column.
134      * <p>
135      * This method is currently equivalent to
136      * <code>getTotalPosition() != Bucket.TOTAL_POSITION_NONE</code> and is therefore
137      * redundant.
138      *
139      * @return whether the group has a total row/column
140      */

141     public boolean hasTotal();
142 }
143
Popular Tags