@Override public ArrayList<Cash> getCash() { Iterator<Assets> portItr = Portfolio.iterator(); ArrayList<Cash> ret = new ArrayList<Cash>(); while (portItr.hasNext()) { Assets thisAsset = portItr.next(); if (thisAsset.toString() == "Cash") { ret.add((Cash) thisAsset); } } return ret; }
@Override public double getTotalCash() { Iterator<Assets> portItr = Portfolio.iterator(); double totCash = 0; while (portItr.hasNext()) { Assets thisAsset = portItr.next(); if (thisAsset.toString() == "Cash") { totCash += thisAsset.getCurrentFMV(); } } return totCash; }