Пример #1
0
 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;
 }
Пример #2
0
 public void addCreditCard(CreditCard aCreditCard) {
   cards.insert(aCreditCard, aCreditCard);
 }
Пример #3
0
 public int cardCount() {
   return cards.size();
 }
Пример #4
0
 public ListIterator getCards() {
   return cards.dataIterator();
 }