| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ImmutableBudgetCategory |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Created on Aug 12, 2007 by wyatt | |
| 3 | */ | |
| 4 | package org.homeunix.thecave.buddi.plugin.api.model; | |
| 5 | ||
| 6 | import java.util.Date; | |
| 7 | import java.util.List; | |
| 8 | ||
| 9 | import org.homeunix.thecave.buddi.model.BudgetCategory; | |
| 10 | ||
| 11 | public interface ImmutableBudgetCategory extends ImmutableSource { | |
| 12 | ||
| 13 | /** | |
| 14 | * Returns the budgeted amount for the given date. | |
| 15 | * | |
| 16 | * @param date | |
| 17 | * @return | |
| 18 | */ | |
| 19 | public long getAmount(Date date); | |
| 20 | ||
| 21 | /** | |
| 22 | * Returns the budgeted amount spread across the date range. For instance, given | |
| 23 | * a monthly budget period, and the date range Sept 15 - Sept 30, and September | |
| 24 | * had a value of 100 for the given budget category, we would return 50. | |
| 25 | * | |
| 26 | * @param startDate | |
| 27 | * @param endDate | |
| 28 | * @return | |
| 29 | */ | |
| 30 | public long getAmount(Date startDate, Date endDate); | |
| 31 | ||
| 32 | /** | |
| 33 | * Returns the wrapped object from the underlying data model. By | |
| 34 | * accessing this method, you bypass all protection which the Buddi API | |
| 35 | * gives you; it is not recommended to use this method unless you understand | |
| 36 | * the risks associated with it. | |
| 37 | * @return | |
| 38 | */ | |
| 39 | public BudgetCategory getBudgetCategory(); | |
| 40 | ||
| 41 | /** | |
| 42 | * Returns all visible children of this budget category. 'Visible Children' are | |
| 43 | * defined to be all children which do not have the deleted flag set, plus all | |
| 44 | * children which have the deleted flag set IIF the Preferences define that the user | |
| 45 | * wants to see deleted sources. | |
| 46 | * | |
| 47 | * This method is mostly used for GUI functions, such as reports and graphs; if you | |
| 48 | * want to access the model it is usually a better idea to use the getAllChildren() | |
| 49 | * method, which will return all children regardless of delete flag state. | |
| 50 | * @return | |
| 51 | */ | |
| 52 | public List<ImmutableBudgetCategory> getImmutableChildren(); | |
| 53 | ||
| 54 | /** | |
| 55 | * Returns all children of this budget category, regardless of delete flag state. | |
| 56 | * @return | |
| 57 | */ | |
| 58 | public List<ImmutableBudgetCategory> getAllImmutableChildren(); | |
| 59 | ||
| 60 | /** | |
| 61 | * Returns the budget period type associated with this budget category. | |
| 62 | * @return | |
| 63 | */ | |
| 64 | public ImmutableBudgetCategoryType getBudgetPeriodType(); | |
| 65 | ||
| 66 | /** | |
| 67 | * Returns the parent of this ImmutableBudgetCategory, or null if there is no parent. | |
| 68 | * @return | |
| 69 | */ | |
| 70 | public ImmutableBudgetCategory getParent(); | |
| 71 | ||
| 72 | /** | |
| 73 | * Does this ImmutableBudgetCategory represent an income category? | |
| 74 | * @return | |
| 75 | */ | |
| 76 | public boolean isIncome(); | |
| 77 | ||
| 78 | /** | |
| 79 | * Returns a list of all dates for this budget period which have budget information | |
| 80 | * set for them. Any date for this budget period which has an associated amount | |
| 81 | * of anything other than zero will be returned here. | |
| 82 | * @return | |
| 83 | */ | |
| 84 | public List<Date> getBudgetedDates(); | |
| 85 | } |