KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > chart > Dataset


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * Dataset.java
28  *
29  * Created on 8 luglio 2005, 17.49
30  *
31  */

32
33 package it.businesslogic.ireport.chart;
34
35 import it.businesslogic.ireport.JRSubreportParameter;
36 import it.businesslogic.ireport.SubDataset;
37 import java.util.Vector JavaDoc;
38
39 /**
40  *
41  * @author Administrator
42  */

43 public class Dataset {
44     
45     
46     private String JavaDoc resetType="Report";
47     private String JavaDoc resetGroup="";
48     private String JavaDoc incrementType="None";
49     private String JavaDoc incrementGroup="";
50     private String JavaDoc incrementWhenExpression="";
51     private String JavaDoc connectionExpression="";
52     private String JavaDoc dataSourceExpression="";
53     private String JavaDoc parametersMapExpression="";
54     private boolean useConnection = false;
55     private Vector JavaDoc subreportParameters = new Vector JavaDoc();
56     
57     private SubDataset subDataset = null;
58     
59         
60     /** Creates a new instance of Dataset */
61     public Dataset() {
62     }
63
64     public String JavaDoc getResetType() {
65         return resetType;
66     }
67
68     public void setResetType(String JavaDoc resetType) {
69         this.resetType = resetType;
70     }
71
72     public String JavaDoc getResetGroup() {
73         return resetGroup;
74     }
75
76     public void setResetGroup(String JavaDoc resetGroup) {
77         this.resetGroup = resetGroup;
78     }
79
80     public String JavaDoc getIncrementType() {
81         return incrementType;
82     }
83
84     public void setIncrementType(String JavaDoc incrementType) {
85         this.incrementType = incrementType;
86     }
87
88     public String JavaDoc getIncrementGroup() {
89         return incrementGroup;
90     }
91
92     public void setIncrementGroup(String JavaDoc incrementGroup) {
93         this.incrementGroup = incrementGroup;
94     }
95     
96     public Dataset cloneMe()
97     {
98         Dataset ds = new Dataset();
99         copyBaseDataset(ds);
100         return ds;
101     }
102     
103     public void copyBaseDataset(Dataset ds)
104     {
105         ds.setIncrementType( getIncrementType());
106         ds.setIncrementGroup( getIncrementGroup());
107         ds.setResetType( getResetType());
108         ds.setResetGroup( getResetGroup());
109         ds.setUseConnection( isUseConnection());
110         ds.setSubDataset( this.getSubDataset());
111         ds.setParametersMapExpression( getParametersMapExpression());
112         ds.setConnectionExpression( getConnectionExpression());
113         ds.setDataSourceExpression( getDataSourceExpression());
114         for (int i=0; i< getSubreportParameters().size(); ++i)
115         {
116             ds.getSubreportParameters().add( ((JRSubreportParameter)getSubreportParameters().elementAt(i)).cloneMe() );
117         }
118     }
119     
120         public String JavaDoc getConnectionExpression() {
121         return connectionExpression;
122     }
123
124     public void setConnectionExpression(String JavaDoc connectionExpression) {
125         this.connectionExpression = connectionExpression;
126     }
127
128     public String JavaDoc getDataSourceExpression() {
129         return dataSourceExpression;
130     }
131
132     public void setDataSourceExpression(String JavaDoc dataSourceExpression) {
133         this.dataSourceExpression = dataSourceExpression;
134     }
135
136     public String JavaDoc getParametersMapExpression() {
137         return parametersMapExpression;
138     }
139
140     public void setParametersMapExpression(String JavaDoc parametersMapExpression) {
141         this.parametersMapExpression = parametersMapExpression;
142     }
143
144     public boolean isUseConnection() {
145         return useConnection;
146     }
147
148     public void setUseConnection(boolean useConnection) {
149         this.useConnection = useConnection;
150     }
151
152     public Vector JavaDoc getSubreportParameters() {
153         return subreportParameters;
154     }
155
156     public void setSubreportParameters(Vector JavaDoc subreportParameters) {
157         this.subreportParameters = subreportParameters;
158     }
159
160     public SubDataset getSubDataset() {
161         return subDataset;
162     }
163
164     public void setSubDataset(SubDataset subDataset) {
165         this.subDataset = subDataset;
166     }
167
168     public String JavaDoc getIncrementWhenExpression() {
169         return incrementWhenExpression;
170     }
171
172     public void setIncrementWhenExpression(String JavaDoc incrementWhenExpression) {
173         this.incrementWhenExpression = incrementWhenExpression;
174     }
175
176 }
177
Popular Tags