edu.trinity.cs.bmassing.bank
Class Account

java.lang.Object
  extended by edu.trinity.cs.bmassing.bank.Account
All Implemented Interfaces:
HasPersonInfo
Direct Known Subclasses:
CheckingAccount, SavingsAccount

public abstract class Account
extends java.lang.Object
implements HasPersonInfo

Class for bank accounts. (If I had more to say about this class, I could say it here.)


Field Summary
protected  double balance
           
static int BANK_ROUTING_NUMBER
           
 
Constructor Summary
Account(double balance, java.lang.String accountHolderName, java.lang.String[] accountHolderAddress, int accountNumber)
          Constructor allowing setting initial values of all variables.
 
Method Summary
abstract  double addInterest()
          Compute and add interest.
 double deposit(double amount)
          Deposit some money.
 int getAccountNumber()
          Get account number.
 java.lang.String[] getAddress()
          Get account holder address.
 double getBalance()
          Get balance.
 java.lang.String getName()
          Get account holder name.
static void main(java.lang.String[] args)
          Main program to do some simple tests.
 double withdraw(double amount)
          Withdraw some money.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

balance

protected double balance

BANK_ROUTING_NUMBER

public static final int BANK_ROUTING_NUMBER
See Also:
Constant Field Values
Constructor Detail

Account

public Account(double balance,
               java.lang.String accountHolderName,
               java.lang.String[] accountHolderAddress,
               int accountNumber)
Constructor allowing setting initial values of all variables.

Method Detail

deposit

public double deposit(double amount)
Deposit some money.

Parameters:
amount -
Returns:
new balance

withdraw

public double withdraw(double amount)
                throws InsufficientFundsException
Withdraw some money.

Parameters:
amount -
Returns:
new balance
Throws:
java.lang.RuntimeException - if amount is more than balance
InsufficientFundsException

getName

public java.lang.String getName()
Get account holder name.

Specified by:
getName in interface HasPersonInfo
Returns:
full name

getAddress

public java.lang.String[] getAddress()
Get account holder address.

Specified by:
getAddress in interface HasPersonInfo
Returns:
copy of address

getBalance

public double getBalance()
Get balance.


getAccountNumber

public int getAccountNumber()
Get account number.


addInterest

public abstract double addInterest()
Compute and add interest.

Returns:
new balance

main

public static void main(java.lang.String[] args)
Main program to do some simple tests.

Parameters:
args - command-line arguments (unused)