Class FeeAccount

java.lang.Object
  extended byBankAccount
      extended byFeeAccount
All Implemented Interfaces:
Serializable

public class FeeAccount
extends BankAccount

A FeeAccount is a BankAccount with one new feature: the user is charged for each transaction.

Version:
7
See Also:
BankAccount, Serialized Form

Constructor Summary
FeeAccount(int initialBalance, Bank issuingBank)
          Constructor, accepting an initial balance and issuing Bank.
 
Method Summary
 void countTransaction()
          The way a transaction is counted for a FeeAccount: it levies a transaction fee as well as counting the transaction.
protected  int getTransactionFee()
          The Bank's transaction fee.
 void newMonth()
          A FeeAccount incurs a monthly charge.
 
Methods inherited from class BankAccount
deposit, getBalance, getIssuingBank, getTransactionCount, incrementBalance, requestBalance, withdraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeeAccount

public FeeAccount(int initialBalance,
                  Bank issuingBank)
           throws InsufficientFundsException
Constructor, accepting an initial balance and issuing Bank.

Parameters:
initialBalance - the opening balance.
issuingBank - the bank that issued this account.
Throws:
InsufficientFundsException - when appropriate.
Method Detail

countTransaction

public void countTransaction()
                      throws InsufficientFundsException
The way a transaction is counted for a FeeAccount: it levies a transaction fee as well as counting the transaction.

Overrides:
countTransaction in class BankAccount
Throws:
InsufficientFundsException - when appropriate.

getTransactionFee

protected int getTransactionFee()
The Bank's transaction fee.

Overrides:
getTransactionFee in class BankAccount
Returns:
the fee.

newMonth

public void newMonth()
              throws InsufficientFundsException
A FeeAccount incurs a monthly charge.

Specified by:
newMonth in class BankAccount
Throws:
InsufficientFundsException - when appropriate.