public class OfflineAccountProxy extends Account
accountNumber, transactions
Constructor and Description |
---|
OfflineAccountProxy(int accountNumber) |
Modifier and Type | Method and Description |
---|---|
int |
accountBalance() |
boolean |
balanceIsAccessible() |
boolean |
newWithdrawalIsPossible(int amount)
Determine whether a certain amount of money may be withdrawn.
|
void |
replay(PermanentAccount target)
Make the transactions buffered in
this object persistent
by copying them to a permanent account |
void |
requestStatement()
Request a printed account statement.
|
void |
withdraw(int amount)
Withdraw
amount from the account |
addTransaction, checkAndWithdraw, flushTransactions, getAccountNumber, getTransactions, transactionListToString
public void withdraw(int amount)
amount
from the accountpublic void requestStatement()
requestStatement
in class Account
public boolean balanceIsAccessible()
balanceIsAccessible
in class Account
true
iff the balance of this account can be
determined (not possible for the offline situation)public int accountBalance()
accountBalance
in class Account
public boolean newWithdrawalIsPossible(int amount)
PermanentAccount.withdraw(int,int)
it is possible to
circumvent this check, which is necessary because for offline withdrawals
the balance cannot be accessed and checkednewWithdrawalIsPossible
in class Account
amount
- the amount of money requestedtrue
iff amount
can be withdrawn
from the accountpublic void replay(PermanentAccount target)
this
object persistent
by copying them to a permanent accounttarget
- the account the transactions are supposed to be copied to