Repository navigation
Expand file tree
/
Copy pathEquity.java
More file actions
69 lines (59 loc) · 1.34 KB
/
Copy pathEquity.java
File metadata and controls
69 lines (59 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package jr.eecs1022.finpro;
import java.util.Date;
/**
* This class encapsulates an equity investment.
* @author H. Roumani
* @since Winter 2016.
*/
public class Equity
{
private String symbol;
private int qty;
private double bookValue;
private Date acquired;
private double marketValue;
private double yield;
public Equity(String symbol, int qty, double bookValue, Date acquired, double marketValue, double yield)
{
this.symbol = symbol;
this.qty = qty;
this.bookValue = bookValue;
this.acquired = acquired;
this.marketValue = marketValue;
this.yield = yield;
}
public String getSymbol()
{
return this.symbol;
}
public int getQty()
{
return this.qty;
}
public double getBookValue()
{
return bookValue;
}
public Date getAcquired()
{
return this.acquired;
}
public double getMarketValue()
{
return this.marketValue;
}
public double getYield()
{
return this.yield;
}
@Override
public String toString()
{
return "Equity{" +
"symbol='" + this.symbol + '\'' +
", qty=" + this.qty +
", bookValue=" + this.bookValue +
", acquired=" + this.acquired +
'}';
}
}