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

Change class name

parent bf173046
public class BuyTrade extends Trade {
BuyTrade(int time, Customer c, Stock stock, int qty, float price) {
public class BuyOrder extends Order {
BuyOrder(int time, Customer c, Stock stock, int qty, float price) {
super(time, "BUY", c, stock, qty, price);
}
}
......@@ -3,7 +3,7 @@
* for both SellTrade and BuyTrade classes that will inherit
* for it.
*/
public abstract class Trade {
public abstract class Order {
int qty;
float price;
int time;
......@@ -11,7 +11,7 @@ public abstract class Trade {
Customer c;
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.price = price;
this.c = c;
......@@ -43,7 +43,7 @@ public abstract class Trade {
// type check and case
if (getClass() != o.getClass()) return false;
Trade t = (Trade) o;
Order t = (Order) o;
return this.time == t.getTime() && this.type.equals(t.getType())
&& this.c.equals(t.getCustomer()) && this.stock.equals(t.getStock())
......
public class SellTrade extends Trade {
SellTrade(int time, Customer c, Stock stock, int qty, float price) {
public class SellOrder extends Order {
SellOrder(int time, Customer c, Stock stock, int qty, float 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