/Users/johnr/Dropbox/johnrayworth.info/largeFilesOutsideJSR/__IB-Other/Other/IA-Solutions-2019/Guy/Product/Investor's Application IA Working Final Draft/src/investor/s/application/ia/Stock.java |
1
2
3
4
5
6 package investor.s.application.ia;
7
8
9
10 @author
11
12 import java.util.ArrayList;
13 import static java.util.Collections.list;
14 public class Stock {
15
16 private String stockName = "not set yet";
17 private double totalAmountInvested = -999.99;
18 private double averagePrice = -999.99;
19 private double netProfit = -999.99;
20 private int sharesOwned = -999;
21 private double totalDividends = -999.99;
22 private ArrayList<Transaction[]> transactions = new ArrayList<Transaction[]>();
23
24
25 public Stock(){
26
27 }
28
29 public Stock(String stockName, double totalAmountInvested, double averagePrice, double netProfit, int sharesOwned, double totalDividends, ArrayList<Transaction[]> transactions){
30 this.stockName = stockName;
31 this.totalAmountInvested = totalAmountInvested;
32 this.averagePrice = averagePrice;
33 this.netProfit = netProfit;
34 this.sharesOwned = sharesOwned;
35 this.totalDividends = totalDividends;
36 this.transactions = transactions;
37 }
38
39
40 public String stockName(){
41 return stockName;
42 }
43
44 public double getTotalAmountInvested(){
45 return totalAmountInvested;
46 }
47
48 public double getAveragePrice(){
49 return averagePrice;
50 }
51
52 public double getNetProfit(){
53 return netProfit;
54 }
55
56
57 public int getSharesOwned(){
58 return sharesOwned;
59 }
60
61 public double getTotalDividends(){
62 return totalDividends;
63 }
64
65 public ArrayList<Transaction[]> transactions(){
66 return transactions;
67 }
68
69
70 public void setStockName(String stockName){
71 this.stockName = stockName;
72 }
73
74 public void totalAmountInvested(double totalAmountInvested){
75 this.totalAmountInvested = totalAmountInvested;
76 }
77
78 public void setAveragePrice(double averagePrice){
79 this.averagePrice = averagePrice;
80 }
81 public void setNetProfit(double netProfit){
82 this.netProfit = netProfit;
83 }
84
85 public void setSharesOwned(int sharesOwned){
86 this.sharesOwned = sharesOwned;
87 }
88
89 public void setTotalDividends(double totalDividends){
90 this.totalDividends = totalDividends;
91 }
92
93 public void setTransactions(ArrayList<Transaction[]> transactions){
94 this.transactions = transactions;
95 }
96
97
98 }
99