示例#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();
 }