KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > webservices > finance > stockmarket > BaseStockQuote


1 /*
2  * Copyright 2000-2001,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.jetspeed.webservices.finance.stockmarket;
18
19 /**
20     BaseStockQuote implements StockQuote,
21     holding the information for one company's quote.
22         
23     @author <a HREF="mailto:taylor@apache.org">David Sean Taylor</a>
24     @version $Id: BaseStockQuote.java,v 1.2 2004/02/23 03:15:29 jford Exp $
25 */

26
27 public class BaseStockQuote implements StockQuote
28 {
29     String JavaDoc price = "";
30     String JavaDoc name = "";
31     String JavaDoc symbol = "";
32     String JavaDoc time = "";
33     String JavaDoc date = "";
34     String JavaDoc high = "";
35     String JavaDoc volume = "";
36     String JavaDoc change = "";
37     String JavaDoc opening = "";
38     String JavaDoc low = "";
39
40     public void setPrice(String JavaDoc v)
41     {
42         price = v;
43     }
44
45     public String JavaDoc getPrice()
46     {
47         return price;
48     }
49
50     public void setName(String JavaDoc v)
51     {
52         name = v;
53     }
54
55     public String JavaDoc getName()
56     {
57         return name;
58     }
59
60     public void setSymbol(String JavaDoc v)
61     {
62         symbol = v;
63     }
64
65     public String JavaDoc getSymbol()
66     {
67         return symbol;
68     }
69
70     public void setTime(String JavaDoc v)
71     {
72         time = v;
73     }
74
75     public String JavaDoc getTime()
76     {
77         return time;
78     }
79
80     public void setDate(String JavaDoc v)
81     {
82         date = v;
83     }
84
85     public String JavaDoc getDate()
86     {
87         return date;
88     }
89
90     public void setHigh(String JavaDoc v)
91     {
92         high = v;
93     }
94
95     public String JavaDoc getHigh() // subliminal
96
{
97         return high;
98     }
99
100     public void setVolume(String JavaDoc v)
101     {
102         volume = v;
103     }
104
105     public String JavaDoc getVolume()
106     {
107         return volume;
108     }
109
110     public void setChange(String JavaDoc v)
111     {
112         change = v;
113     }
114
115     public String JavaDoc getChange()
116     {
117         return change;
118     }
119
120     public void setOpening(String JavaDoc v)
121     {
122         opening = v;
123     }
124
125     public String JavaDoc getOpening()
126     {
127         return opening;
128     }
129
130     public void setLow(String JavaDoc v)
131     {
132         low = v;
133     }
134
135     public String JavaDoc getLow()
136     {
137         return low;
138     }
139
140     public String JavaDoc toString()
141     {
142         return toXML();
143     }
144
145     public String JavaDoc toXML()
146     {
147         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
148         buffer.append(" <Price>");
149         buffer.append(price);
150         buffer.append("</Price>\n");
151         buffer.append(" <Name>");
152         buffer.append(name);
153         buffer.append("</Name>\n");
154         buffer.append(" <Symbol>");
155         buffer.append(symbol);
156         buffer.append("</Symbol>\n");
157         buffer.append(" <Time>");
158         buffer.append(time);
159         buffer.append("</Time>\n");
160         buffer.append(" <Date>");
161         buffer.append(date);
162         buffer.append("</Date>\n");
163         buffer.append(" <High>");
164         buffer.append(high);
165         buffer.append("</High>\n");
166         buffer.append(" <Volume>");
167         buffer.append(volume);
168         buffer.append("</Volume>\n");
169         buffer.append(" <Change>");
170         buffer.append(change);
171         buffer.append("</Change>\n");
172         buffer.append(" <Low>");
173         buffer.append(low);
174         buffer.append("</Low>\n");
175         return buffer.toString();
176     }
177
178 }
179
Popular Tags