1 package indyjug.jboss.ejb;
2
3 import java.util.Date;
4
5 public class OrderValue implements java.io.Serializable
6 {
7 private StockValue stock;
8 private String action;
9 private Date date;
10 private Double price;
11 private Double shares;
12
13 public OrderValue()
14 {
15 }
16
17 public OrderValue(StockValue stock, String action, Date date, double price,
18 double shares)
19 {
20 this(stock, action, date, new Double(price), new Double(shares));
21 }
22
23 public OrderValue(StockValue stock, String action, Date date, Double price,
24 Double shares)
25 {
26 setStock(stock);
27 setAction(action);
28 setDate(date);
29 setPrice(price);
30 setShares(shares);
31 }
32
33 public StockValue getStock()
34 {
35 return stock;
36 }
37
38 public void setStock(StockValue stock)
39 {
40 this.stock = stock;
41 }
42
43 public String getAction()
44 {
45 return action;
46 }
47
48 public void setAction(String action)
49 {
50 this.action = action;
51 }
52
53 public Date getDate()
54 {
55 return date;
56 }
57
58 public void setDate(Date date)
59 {
60 this.date = date;
61 }
62
63 public Double getPrice()
64 {
65 return price;
66 }
67
68 public void setPrice(Double price)
69 {
70 this.price = price;
71 }
72
73 public Double getShares()
74 {
75 return shares;
76 }
77
78 public void setShares(Double shares)
79 {
80 this.shares = shares;
81 }
82
83 public String toString()
84 {
85 StringBuffer str = new StringBuffer("[");
86
87 str.append("stock=" + getStock() + " " + "action=" + getAction() + " " +
88 "date=" + getDate() + " " + "price=" + getPrice() + " " +
89 "shares=" + getShares());
90 str.append(']');
91
92 return (str.toString());
93 }
94
95 public boolean equals(Object other)
96 {
97 if (this == other)
98 {
99 return true;
00 }
01
02 if (other instanceof OrderValue)
03 {
04 OrderValue that = (OrderValue)other;
05 boolean lEquals = true;
06
07 return lEquals;
08 }
09 else
10 {
11 return false;
12 }
13 }
14
15 public int hashCode()
16 {
17 int result = 17;
18 result = (37 * result) +
19 ((this.stock != null) ? this.stock.hashCode() : 0);
20
21 result = (37 * result) +
22 ((this.action != null) ? this.action.hashCode() : 0);
23
24 result = (37 * result) +
25 ((this.date != null) ? this.date.hashCode() : 0);
26
27 result = (37 * result) +
28 ((this.price != null) ? this.price.hashCode() : 0);
29
30 result = (37 * result) +
31 ((this.shares != null) ? this.shares.hashCode() : 0);
32
33 return result;
34 }
35}
36