FileDocCategorySizeDatePackage
CheckingAccount.javaAPI DocExample3613Sun Mar 02 21:34:00 GMT 1997bank.server

CheckingAccount

public class CheckingAccount extends Account implements RemoteCheckingAccount
A checking account represents a type of account against which people may make overdrafts covered by other savings accounts they hold. If they cannot cover an overdraft, then a withdrawal will fail.

Fields Summary
Constructors Summary
public CheckingAccount()
Constructs a new checking account.

Methods Summary
public synchronized voidwithdraw(imaginary.persist.RemoteLockHolder h, float amount)
Extends the Account withdraw method. Here, it checks to see if the customer has enough money in the account. If they do not have enough money to make the withdrawal, then it checks the customers savings accounts in an attempt to cover. If the savings accounts will cover the withdrawal, then the proper amount is transfered to this account from those accounts and the withdrawal succeeds. If not enough money can be transfered to cover the withdrawal, it fails.

param
trans the Transaction used for modifying the account
param
amount the (non-zero) amount of money being withdrawn
exception
AccountException Insufficient functions for withdrawal
exception
imaginary.persist.LockException Another Transaction holds a lock on one or more of the affected accounts.