|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttopdown.service.Account
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 |
private java.lang.String m_accountName
private float m_accountBalance
private java.lang.String m_accountID
| Constructor Detail |
public Account(java.lang.String name,
float balance)
throws AccountException
name - The name of the account owner.balance - The beginning balance of the account.
AccountException - if there are not sufficient funds (>0) for the initial balance.| Method Detail |
public java.lang.String getAccountName()
public void setAccountName(java.lang.String accountName)
accountName - the name of the account owner.public java.lang.String getAccountID()
public void setAccountID(java.lang.String accountID)
accountID - the account ID.public float getBalance()
public void deposit(float funds)
funds - the amount of funds to deposit.
public void withdraw(float funds)
throws AccountException
funds - the amount of money to withdraw.
AccountException - if the amount exceeds the maximum allowed withdrawl ($2000.00).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||