| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Account |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Created on Jul 30, 2007 by wyatt | |
| 3 | */ | |
| 4 | package org.homeunix.thecave.buddi.model; | |
| 5 | ||
| 6 | import java.util.Date; | |
| 7 | ||
| 8 | import org.homeunix.thecave.buddi.plugin.api.exception.InvalidValueException; | |
| 9 | ||
| 10 | public interface Account extends Source{ | |
| 11 | ||
| 12 | /** | |
| 13 | * Get the account type | |
| 14 | * @return | |
| 15 | */ | |
| 16 | public AccountType getAccountType(); | |
| 17 | /** | |
| 18 | * Returns the current balance. This is a volatile value, and is | |
| 19 | * generated by calling updateBalance(). | |
| 20 | * @return | |
| 21 | */ | |
| 22 | public long getBalance(); | |
| 23 | /** | |
| 24 | * Returns the balance as of the given date. | |
| 25 | * @param d | |
| 26 | * @return | |
| 27 | */ | |
| 28 | public long getBalance(Date d); | |
| 29 | /** | |
| 30 | * Returns the starting date of this account. | |
| 31 | * @return | |
| 32 | */ | |
| 33 | public Date getStartDate(); | |
| 34 | /** | |
| 35 | * Sets the starting date of this account. | |
| 36 | * @param startDate | |
| 37 | */ | |
| 38 | public void setStartDate(Date startDate); | |
| 39 | /** | |
| 40 | * Returns the starting balance associated with this account. | |
| 41 | * @return | |
| 42 | */ | |
| 43 | public long getStartingBalance(); | |
| 44 | /** | |
| 45 | * Sets the account type | |
| 46 | * @param accountType | |
| 47 | * @throws InvalidValueException | |
| 48 | */ | |
| 49 | public void setAccountType(AccountType accountType) throws InvalidValueException; | |
| 50 | /** | |
| 51 | * Sets the starting balance | |
| 52 | * @param startingBalance | |
| 53 | * @throws InvalidValueException | |
| 54 | */ | |
| 55 | public void setStartingBalance(long startingBalance) throws InvalidValueException; | |
| 56 | /** | |
| 57 | * Updates the balance for this account, by navigating all associated transactions. | |
| 58 | * Calling this will also update the balanceTo or balanceFrom fields in | |
| 59 | * each transaction, representing the balance at the time of that transaction. | |
| 60 | */ | |
| 61 | public void updateBalance(); | |
| 62 | ||
| 63 | /** | |
| 64 | * Sets the overdraft limit for debit accounts, or the credit limit for credit accounts. | |
| 65 | * @param overdraftLimit | |
| 66 | */ | |
| 67 | public void setOverdraftCreditLimit(long overdraftLimit) throws InvalidValueException; | |
| 68 | ||
| 69 | /** | |
| 70 | * Returns the overdraft limit for Debit accounts, or Credit Limit for Credit accounts. | |
| 71 | * @return | |
| 72 | */ | |
| 73 | public long getOverdraftCreditLimit(); | |
| 74 | ||
| 75 | /** | |
| 76 | * Returns the interest rate. The rate is given as a long, to three decimal places; | |
| 77 | * for instance, 6123 would be 6.123%. Zero means the rate has not been set (logical | |
| 78 | * equivalent to null). | |
| 79 | * @return | |
| 80 | */ | |
| 81 | public long getInterestRate(); | |
| 82 | ||
| 83 | /** | |
| 84 | * Sets the interest rate. The rate is given as a long, to three decimal places; | |
| 85 | * for instance, 6123 would be 6.123%. Zero means the rate has not been set (logical | |
| 86 | * equivalent to null). | |
| 87 | * @param interestRate | |
| 88 | */ | |
| 89 | public void setInterestRate(long interestRate) throws InvalidValueException; | |
| 90 | } |