KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > base > JRBaseSubreportReturnValue


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.engine.base;
29
30 import java.io.Serializable JavaDoc;
31
32 import net.sf.jasperreports.engine.JRConstants;
33 import net.sf.jasperreports.engine.JRSubreportReturnValue;
34 import net.sf.jasperreports.engine.JRVariable;
35
36 /**
37  * Base implementation of {@link net.sf.jasperreports.engine.JRSubreportReturnValue JRSubreportReturnValue}.
38  *
39  * @author Lucian Chirita (lucianc@users.sourceforge.net)
40  * @version $Id: JRBaseSubreportReturnValue.java 1229 2006-04-19 13:27:35 +0300 (Wed, 19 Apr 2006) teodord $
41  */

42 public class JRBaseSubreportReturnValue implements JRSubreportReturnValue, Serializable JavaDoc
43 {
44
45     /**
46      *
47      */

48     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
49
50     /**
51      * The name of the subreport variable to be copied.
52      */

53     protected String JavaDoc subreportVariable = null;
54
55     /**
56      * The name of the master variable where the value should be copied.
57      */

58     protected String JavaDoc toVariable = null;
59     
60     /**
61      * The calculation type.
62      */

63     protected byte calculation = JRVariable.CALCULATION_NOTHING;
64     
65     /**
66      * The incrementer factory class name.
67      */

68     protected String JavaDoc incrementerFactoryClassName = null;
69
70     
71     protected JRBaseSubreportReturnValue()
72     {
73     }
74
75     
76     protected JRBaseSubreportReturnValue(JRSubreportReturnValue returnValue, JRBaseObjectFactory factory)
77     {
78         factory.put(returnValue, this);
79
80         subreportVariable = returnValue.getSubreportVariable();
81         toVariable = returnValue.getToVariable();
82         calculation = returnValue.getCalculation();
83         incrementerFactoryClassName = returnValue.getIncrementerFactoryClassName();
84     }
85
86     /**
87      * Returns the name of the subreport variable whose value should be copied.
88      *
89      * @return the name of the subreport variable whose value should be copied.
90      */

91     public String JavaDoc getSubreportVariable()
92     {
93         return this.subreportVariable;
94     }
95
96     /**
97      * Returns the name of the master report variable where the value should be copied.
98      *
99      * @return the name of the master report variable where the value should be copied.
100      */

101     public String JavaDoc getToVariable()
102     {
103         return this.toVariable;
104     }
105
106     /**
107      * Returns the calculation type.
108      * <p>
109      * When copying the value from the subreport, a formula can be applied such that sum,
110      * maximum, average and so on can be computed.
111      *
112      * @return the calculation type.
113      */

114     public byte getCalculation()
115     {
116         return calculation;
117     }
118
119     /**
120      * Returns the incrementer factory class name.
121      * <p>
122      * The factory will be used to increment the value of the master report variable
123      * with the value from the subreport.
124      *
125      * @return the incrementer factory class name.
126      */

127     public String JavaDoc getIncrementerFactoryClassName()
128     {
129         return incrementerFactoryClassName;
130     }
131
132 }
133
Popular Tags