M src/main/java/com/ajtjp/gearcitydata/PBResult.java +7 -1
@@ 11,6 11,7 @@ public class PBResult {
private long marketCap;
private float priceToBook;
private long equity;
+ private long cash;
public String getName() {
return name;
@@ 27,12 28,17 @@ public class PBResult {
public long getEquity() {
return equity;
}
+
+ public long getCash() {
+ return cash;
+ }
- public PBResult(String name, long marketCap, float priceToBook, long equity) {
+ public PBResult(String name, long marketCap, float priceToBook, long equity, long cash) {
this.name = name;
this.marketCap = marketCap;
this.priceToBook = priceToBook;
this.equity = equity;
+ this.cash = cash;
}
@Override
M src/main/java/com/ajtjp/gearcitydata/SaveFile.java +3 -2
@@ 202,7 202,8 @@ public class SaveFile {
" CompanyList.COMPANY_NAME, \n" +
" StockHistory.SharePrice * StockHistory.TotalShares as MarketCap, \n" +
" StockHistory.SharePrice * StockHistory.TotalShares/CompanyList.Equity as PB, \n" +
- " CompanyList.Equity as Equity \n" +
+ " CompanyList.Equity as Equity, \n" +
+ " CompanyList.FUNDS_ONHAND as Cash\n" +
"FROM CompanyList\n" +
"LEFT OUTER JOIN StockHistory on CompanyList.ID = StockHistory.CompanyID\n" +
"AND YEAR = ? AND TURN = ?\n" +
@@ 213,7 214,7 @@ public class SaveFile {
stmt.setInt(2, gameTurn == 1 ? 12 : gameTurn - 1);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
- results.add(new PBResult(rs.getString(1), rs.getLong(2), rs.getFloat(3), rs.getLong(4)));
+ results.add(new PBResult(rs.getString(1), rs.getLong(2), rs.getFloat(3), rs.getLong(4), rs.getLong(5)));
}
return results;
}