예제 #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();
 }