Class BudgetList
java.lang.Object
com.infinitekind.moneydance.model.BudgetList
public class BudgetList
extends java.lang.Object
Container for the budgets in a data file
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBUDGET_CLASS_DISCRETIONARYstatic java.lang.StringBUDGET_CLASS_INCOMEstatic java.lang.StringBUDGET_CLASS_MISCstatic java.lang.StringBUDGET_CLASS_REQUIREDstatic java.lang.StringBUDGET_INTERVAL_MONTHLYstatic java.lang.StringBUDGET_INTERVAL_QUARTERLYstatic java.lang.StringBUDGET_INTERVAL_WEEKLYstatic java.lang.StringBUDGET_INTERVAL_YEARLY -
Method Summary
Modifier and Type Method Description voidaddBudget(Budget budget)Create a new budget, add it to the list, and return itvoidaddListener(BudgetListener listener)Add a listener for events that affect the budget list or the budgets in the list.booleancontainsBudgetWithName(java.lang.String budgetName)BudgetfindCurrentBudget()Return the most recent budget found that contains today's date.java.util.List<Budget>getAllBudgets()BudgetgetBudgetWithID(java.lang.String budgetID)Get the budget with the given key, if anyBudgetgetBudgetWithKey(java.lang.String key)Get the budget with the given key, if anyvoidloadFromLegacyStorage()booleanremoveBudget(Budget budget)Remove the given budget from the list.voidremoveListener(BudgetListener listener)Removeo a listener for events that affect the budget list or the budgets in the list.
-
Field Details
-
BUDGET_INTERVAL_MONTHLY
public static final java.lang.String BUDGET_INTERVAL_MONTHLY- See Also:
- Constant Field Values
-
BUDGET_INTERVAL_WEEKLY
public static final java.lang.String BUDGET_INTERVAL_WEEKLY- See Also:
- Constant Field Values
-
BUDGET_INTERVAL_QUARTERLY
public static final java.lang.String BUDGET_INTERVAL_QUARTERLY- See Also:
- Constant Field Values
-
BUDGET_INTERVAL_YEARLY
public static final java.lang.String BUDGET_INTERVAL_YEARLY- See Also:
- Constant Field Values
-
BUDGET_CLASS_MISC
public static final java.lang.String BUDGET_CLASS_MISC- See Also:
- Constant Field Values
-
BUDGET_CLASS_DISCRETIONARY
public static final java.lang.String BUDGET_CLASS_DISCRETIONARY- See Also:
- Constant Field Values
-
BUDGET_CLASS_REQUIRED
public static final java.lang.String BUDGET_CLASS_REQUIRED- See Also:
- Constant Field Values
-
BUDGET_CLASS_INCOME
public static final java.lang.String BUDGET_CLASS_INCOME- See Also:
- Constant Field Values
-
-
Method Details
-
loadFromLegacyStorage
public void loadFromLegacyStorage() -
addListener
Add a listener for events that affect the budget list or the budgets in the list. -
removeListener
Removeo a listener for events that affect the budget list or the budgets in the list. -
getAllBudgets
-
getBudgetWithKey
Get the budget with the given key, if any -
getBudgetWithID
Get the budget with the given key, if any -
findCurrentBudget
Return the most recent budget found that contains today's date. If none of the budgets contain today's date, then it returns the last budget in the list (sorted alphabetically).- Returns:
- The current budget, or the default one, or
nullif there are none.
-
removeBudget
Remove the given budget from the list. Returns true if the budget was in the list. -
addBudget
Create a new budget, add it to the list, and return it -
containsBudgetWithName
public boolean containsBudgetWithName(java.lang.String budgetName)
-