Commit 89e0dffd authored by Rohit Prasad's avatar Rohit Prasad

Change class name

parent bf173046
public class BuyTrade extends Trade { public class BuyOrder extends Order {
BuyTrade(int time, Customer c, Stock stock, int qty, float price) { BuyOrder(int time, Customer c, Stock stock, int qty, float price) {
super(time, "BUY", c, stock, qty, price); super(time, "BUY", c, stock, qty, price);
} }
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* for both SellTrade and BuyTrade classes that will inherit * for both SellTrade and BuyTrade classes that will inherit
* for it. * for it.
*/ */
public abstract class Trade { public abstract class Order {
int qty; int qty;
float price; float price;
int time; int time;
...@@ -11,7 +11,7 @@ public abstract class Trade { ...@@ -11,7 +11,7 @@ public abstract class Trade {
Customer c; Customer c;
Stock stock; Stock stock;
Trade(int time, String type, Customer c, Stock stock, int qty, float price) { Order(int time, String type, Customer c, Stock stock, int qty, float price) {
this.qty = qty; this.qty = qty;
this.price = price; this.price = price;
this.c = c; this.c = c;
...@@ -43,7 +43,7 @@ public abstract class Trade { ...@@ -43,7 +43,7 @@ public abstract class Trade {
// type check and case // type check and case
if (getClass() != o.getClass()) return false; if (getClass() != o.getClass()) return false;
Trade t = (Trade) o; Order t = (Order) o;
return this.time == t.getTime() && this.type.equals(t.getType()) return this.time == t.getTime() && this.type.equals(t.getType())
&& this.c.equals(t.getCustomer()) && this.stock.equals(t.getStock()) && this.c.equals(t.getCustomer()) && this.stock.equals(t.getStock())
......
public class SellTrade extends Trade { public class SellOrder extends Order {
SellTrade(int time, Customer c, Stock stock, int qty, float price) { SellOrder(int time, Customer c, Stock stock, int qty, float price) {
super(time, "SELL", c, stock, qty, price); super(time, "SELL", c, stock, qty, price);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment