|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object BankAccount
A BankAccount object has private fields to keep track of its current balance, the number of transactions performed and the Bank in which it is an account, and and public methods to access those fields appropriately.
Bank
Constructor Summary | |
BankAccount(int initialBalance,
Bank issuingBank)
Construct a BankAccount with the given initial balance and issuing Bank. |
Method Summary | |
void |
countTransaction()
Increment by 1 the count of transactions, for this account and for the issuing Bank. |
int |
deposit(int amount)
Deposit the given amount, increasing this BankAccount's balance and the issuing Bank's balance. |
int |
getBalance()
Get the current balance. |
Bank |
getIssuingBank()
Get the bank that issued this account. |
int |
getTransactionCount()
Get the number of transactions performed by this account. |
void |
incrementBalance(int amount)
Increment account balance by given amount. |
int |
requestBalance()
Request for balance. |
int |
withdraw(int amount)
Withdraw the given amount, decreasing this BankAccount's balance and the issuing Bank's balance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BankAccount(int initialBalance, Bank issuingBank)
initialBalance
- the opening balance.issuingBank
- the bank that issued this account.Method Detail |
public void countTransaction()
public int deposit(int amount)
amount
- the amount to be deposited
public int getBalance()
public Bank getIssuingBank()
public int getTransactionCount()
public void incrementBalance(int amount)
amount
- the amount increment.public int requestBalance()
public int withdraw(int amount)
amount
- the amount to be withdrawn
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |