Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS682-HW1-OrderMatching
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rohit Prasad
CS682-HW1-OrderMatching
Commits
0a5d53d0
Commit
0a5d53d0
authored
Jan 20, 2018
by
Rohit Prasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stock attribute
parent
2a3c885e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
src/BuyTrade.java
src/BuyTrade.java
+2
-2
src/SellTrade.java
src/SellTrade.java
+2
-2
src/Trade.java
src/Trade.java
+5
-1
No files found.
src/BuyTrade.java
View file @
0a5d53d0
public
class
BuyTrade
extends
Trade
{
BuyTrade
(
int
time
,
Customer
c
,
int
qty
,
float
price
)
{
super
(
time
,
"BUY"
,
c
,
qty
,
price
);
BuyTrade
(
int
time
,
Customer
c
,
Stock
stock
,
int
qty
,
float
price
)
{
super
(
time
,
"BUY"
,
c
,
stock
,
qty
,
price
);
}
}
src/SellTrade.java
View file @
0a5d53d0
public
class
SellTrade
extends
Trade
{
SellTrade
(
int
time
,
Customer
c
,
int
qty
,
float
price
)
{
super
(
time
,
"SELL"
,
c
,
qty
,
price
);
SellTrade
(
int
time
,
Customer
c
,
Stock
stock
,
int
qty
,
float
price
)
{
super
(
time
,
"SELL"
,
c
,
stock
,
qty
,
price
);
}
}
src/Trade.java
View file @
0a5d53d0
...
...
@@ -4,13 +4,15 @@ public abstract class Trade {
int
time
;
String
type
;
Customer
c
;
Stock
stock
;
Trade
(
int
time
,
String
type
,
Customer
c
,
int
qty
,
float
price
)
{
Trade
(
int
time
,
String
type
,
Customer
c
,
Stock
stock
,
int
qty
,
float
price
)
{
this
.
qty
=
qty
;
this
.
price
=
price
;
this
.
c
=
c
;
this
.
time
=
time
;
this
.
type
=
type
;
this
.
stock
=
stock
;
}
int
getQty
()
{
return
qty
;
}
...
...
@@ -22,4 +24,6 @@ public abstract class Trade {
String
getType
()
{
return
type
;
}
Customer
getCustomer
()
{
return
c
;
}
Stock
getStock
()
{
return
stock
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment