public double getBalance() { double totalBal = 0.0; if (cardCount() == 0) return 0.0; else { ListIterator iter = cards.dataIterator(); while (iter.hasNext()) { CreditCard tmp = (CreditCard) iter.next(); totalBal += tmp.getCredit(); } } return totalBal; }
public void addCreditCard(CreditCard aCreditCard) { cards.insert(aCreditCard, aCreditCard); }
public int cardCount() { return cards.size(); }
public ListIterator getCards() { return cards.dataIterator(); }