topdown.service
Class Account

java.lang.Object
  extended bytopdown.service.Account

public class Account
extends java.lang.Object

This class represents a bank account.


Field Summary
private  float m_accountBalance
          The account balance.
private  java.lang.String m_accountID
          The account ID.
private  java.lang.String m_accountName
          The account owner's name.
 
Constructor Summary
Account(java.lang.String name, float balance)
          Creates a bank account.
 
Method Summary
 void deposit(float funds)
          Deposits funds into the account and updates the balance.
 java.lang.String getAccountID()
          Returns the account ID.
 java.lang.String getAccountName()
          Returns the account owner's name.
 float getBalance()
          Returns the current balance of the account.
 void setAccountID(java.lang.String accountID)
          Sets the account ID.
 void setAccountName(java.lang.String accountName)
          Sets the account owner's name.
 void withdraw(float funds)
          Withdraws funds from the account and updates the balance accordingly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_accountName

private java.lang.String m_accountName
The account owner's name.


m_accountBalance

private float m_accountBalance
The account balance.


m_accountID

private java.lang.String m_accountID
The account ID.

Constructor Detail

Account

public Account(java.lang.String name,
               float balance)
        throws AccountException
Creates a bank account.

Parameters:
name - The name of the account owner.
balance - The beginning balance of the account.
Throws:
AccountException - if there are not sufficient funds (>0) for the initial balance.
Method Detail

getAccountName

public java.lang.String getAccountName()
Returns the account owner's name.

Returns:
the owner's name.

setAccountName

public void setAccountName(java.lang.String accountName)
Sets the account owner's name.

Parameters:
accountName - the name of the account owner.

getAccountID

public java.lang.String getAccountID()
Returns the account ID.

Returns:
the account ID.

setAccountID

public void setAccountID(java.lang.String accountID)
Sets the account ID.

Parameters:
accountID - the account ID.

getBalance

public float getBalance()
Returns the current balance of the account.

Returns:
the account balance.

deposit

public void deposit(float funds)
Deposits funds into the account and updates the balance.

Parameters:
funds - the amount of funds to deposit.

withdraw

public void withdraw(float funds)
              throws AccountException
Withdraws funds from the account and updates the balance accordingly.

Parameters:
funds - the amount of money to withdraw.
Throws:
AccountException - if the amount exceeds the maximum allowed withdrawl ($2000.00).