View Javadoc

1   /*
2    *  
3    *  author nambi sankaran
4    *  copyright (C) 2009 nambi sankaran.
5    *
6    *  This program is free software: you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation, either version 3 of the License, or
9    *  (at your option) any later version.
10   *
11   *  This program is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *  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/>.
18   *
19   */
20  package net.sf.emarket.quote.domain;
21  
22  import java.io.Serializable;
23  import java.sql.Timestamp;
24  
25  import javax.persistence.Entity;
26  import javax.persistence.Id;
27  
28  @Entity
29  public class Quote implements Serializable{
30  
31  	private static final long serialVersionUID = -5717266315331504299L;
32  
33  	@Id
34  	private long id = 0;
35      private Instrument instrument = new Instrument();
36  	private float askPrice = 0f;
37  	private float bidPrice = 0f;
38  	private float askSize = 0;
39  	private float bidSize = 0;
40      private float change =0;
41  	private int volume = 0;
42  	private float lastPrice = 0;
43  	private float previousClose = 0;
44  	private Timestamp time = null;
45  
46  	public long getId() {
47  		return id;
48  	}
49  	public void setId(long id) {
50  		this.id = id;
51  	}
52  	public String getSymbol() {
53  		return instrument.getSymbol();
54  	}
55  	public void setSymbol(String symbol) {
56  		instrument.setSymbol(symbol);
57  	}
58      public Instrument getInstrument(){
59          return instrument;
60      }
61      public void setInstrument( Instrument inst){
62          if( inst.getSymbol().equals(instrument.getSymbol()) ){
63              instrument = inst;
64          }
65      }
66      public String getDescription(){
67          return instrument.getDescription();
68      }
69  	public float getAskPrice() {
70  		return askPrice;
71  	}
72  	public void setAskPrice(float askPrice) {
73  		this.askPrice = askPrice;
74  	}
75  	public float getBidPrice() {
76  		return bidPrice;
77  	}
78  	public void setBidPrice(float bidPrice) {
79  		this.bidPrice = bidPrice;
80  	}
81  	public float getAskSize() {
82  		return askSize;
83  	}
84  	public void setAskSize(float askSize) {
85  		this.askSize = askSize;
86  	}
87  	public float getBidSize() {
88  		return bidSize;
89  	}
90  	public void setBidSize(float bidSize) {
91  		this.bidSize = bidSize;
92  	}
93      public float getChange(){
94          return change;
95      }
96      public void setChange( float change){
97          this.change = change;        
98      }
99  	public int getVolume() {
100 		return volume;
101 	}
102 	public void setVolume(int volume) {
103 		this.volume = volume;
104 	}
105 	public float getLastPrice() {
106 		return lastPrice;
107 	}
108 	public void setLastPrice(float lastPrice) {
109 		this.lastPrice = lastPrice;
110 	}
111 	public float getPreviousClose() {
112 		return previousClose;
113 	}
114 	public void setPreviousClose(float previousClose) {
115 		this.previousClose = previousClose;
116 	}
117 	public Timestamp getTime() {
118 		return time;
119 	}
120 	public void setTime(Timestamp time) {
121 		this.time = time;
122 	}
123 }