KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > charts > base > JRBaseHighLowDataset


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.charts.base;
29
30 import net.sf.jasperreports.charts.JRHighLowDataset;
31 import net.sf.jasperreports.engine.JRChartDataset;
32 import net.sf.jasperreports.engine.JRConstants;
33 import net.sf.jasperreports.engine.JRExpression;
34 import net.sf.jasperreports.engine.JRExpressionCollector;
35 import net.sf.jasperreports.engine.JRHyperlink;
36 import net.sf.jasperreports.engine.base.JRBaseChartDataset;
37 import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
38 import net.sf.jasperreports.engine.design.JRVerifier;
39
40
41 /**
42  * @author Ionut Nedelcu (ionutned@users.sourceforge.net)
43  * @version $Id: JRBaseHighLowDataset.java 1364 2006-08-31 18:13:20 +0300 (Thu, 31 Aug 2006) lucianc $
44  */

45 public class JRBaseHighLowDataset extends JRBaseChartDataset implements JRHighLowDataset
46 {
47
48     /**
49      *
50      */

51     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
52
53     protected JRExpression seriesExpression;
54     protected JRExpression dateExpression;
55     protected JRExpression highExpression;
56     protected JRExpression lowExpression;
57     protected JRExpression openExpression;
58     protected JRExpression closeExpression;
59     protected JRExpression volumeExpression;
60     private JRHyperlink itemHyperlink;
61
62
63     /**
64      *
65      */

66     public JRBaseHighLowDataset(JRChartDataset dataset)
67     {
68         super(dataset);
69     }
70
71
72     /**
73      *
74      */

75     public JRBaseHighLowDataset(JRHighLowDataset dataset, JRBaseObjectFactory factory)
76     {
77         super(dataset, factory);
78
79         seriesExpression = factory.getExpression(dataset.getSeriesExpression());
80         dateExpression = factory.getExpression(dataset.getDateExpression());
81         highExpression = factory.getExpression(dataset.getHighExpression());
82         lowExpression = factory.getExpression(dataset.getLowExpression());
83         openExpression = factory.getExpression(dataset.getOpenExpression());
84         closeExpression = factory.getExpression(dataset.getCloseExpression());
85         volumeExpression = factory.getExpression(dataset.getVolumeExpression());
86         itemHyperlink = factory.getHyperlink(dataset.getItemHyperlink());
87     }
88
89
90
91     public JRExpression getSeriesExpression()
92     {
93         return seriesExpression;
94     }
95
96
97     public JRExpression getDateExpression()
98     {
99         return dateExpression;
100     }
101
102
103     public JRExpression getHighExpression()
104     {
105         return highExpression;
106     }
107
108
109     public JRExpression getLowExpression()
110     {
111         return lowExpression;
112     }
113
114
115     public JRExpression getOpenExpression()
116     {
117         return openExpression;
118     }
119
120
121     public JRExpression getCloseExpression()
122     {
123         return closeExpression;
124     }
125
126     public JRExpression getVolumeExpression()
127     {
128         return volumeExpression;
129     }
130
131
132     /* (non-Javadoc)
133      * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType()
134      */

135     public byte getDatasetType() {
136         return JRChartDataset.HIGHLOW_DATASET;
137     }
138
139
140     /**
141      *
142      */

143     public void collectExpressions(JRExpressionCollector collector)
144     {
145         collector.collect(this);
146     }
147
148     
149     public JRHyperlink getItemHyperlink()
150     {
151         return itemHyperlink;
152     }
153
154
155     public void validate(JRVerifier verifier)
156     {
157         verifier.verify(this);
158     }
159
160 }
161
Popular Tags