java.lang.ObjectAccount
public class Account
represents a bank account
| Constructor Summary | |
|---|---|
Account(Customer customer,
java.lang.String accountNumber)
Constructor for objects of type Account |
|
| Method Summary | |
|---|---|
void |
addTransaction(Transaction newTransaction)
adds a new Transaction object to the array of contained objects |
java.lang.String |
getAccountNumber()
returns the account number |
double |
getBalance()
returns the account balance |
java.lang.String |
getCustomerName()
returns the customer name |
Transaction |
getTransaction(java.lang.String reference)
gets a contained Transaction object specified by its reference property. |
Transaction[] |
getTransactions()
gets the array of contained Transaction objects |
void |
printDetails()
prints details of the account and its current transactions |
void |
removeTransaction(java.lang.String reference)
removes a contained Transaction object specified by its reference property. |
java.lang.String |
toString()
returns a String representation of this object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Account(Customer customer,
java.lang.String accountNumber)
customer - the customeraccountNumber - the account number| Method Detail |
|---|
public void addTransaction(Transaction newTransaction)
newTransaction - the new Transaction to addpublic java.lang.String getAccountNumber()
public double getBalance()
public java.lang.String getCustomerName()
public Transaction getTransaction(java.lang.String reference)
reference - the reference property value of the target object
public Transaction[] getTransactions()
public void printDetails()
public void removeTransaction(java.lang.String reference)
reference - the reference property value of the target objectpublic java.lang.String toString()
toString in class java.lang.Object