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.String
BUDGET_CLASS_DISCRETIONARY
static java.lang.String
BUDGET_CLASS_INCOME
static java.lang.String
BUDGET_CLASS_MISC
static java.lang.String
BUDGET_CLASS_REQUIRED
static java.lang.String
BUDGET_INTERVAL_MONTHLY
static java.lang.String
BUDGET_INTERVAL_QUARTERLY
static java.lang.String
BUDGET_INTERVAL_WEEKLY
static java.lang.String
BUDGET_INTERVAL_YEARLY
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBudget(Budget budget)
Create a new budget, add it to the list, and return itvoid
addListener(BudgetListener listener)
Add a listener for events that affect the budget list or the budgets in the list.boolean
containsBudgetWithName(java.lang.String budgetName)
Budget
findCurrentBudget()
Return the most recent budget found that contains today's date.java.util.List<Budget>
getAllBudgets()
Budget
getBudgetWithID(java.lang.String budgetID)
Get the budget with the given key, if anyBudget
getBudgetWithKey(java.lang.String key)
Get the budget with the given key, if anyvoid
loadFromLegacyStorage()
boolean
removeBudget(Budget budget)
Remove the given budget from the list.void
removeListener(BudgetListener listener)
Removeo a listener for events that affect the budget list or the budgets in the list.
-
-
-
Field Detail
-
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 Detail
-
loadFromLegacyStorage
public void loadFromLegacyStorage()
-
addListener
public void addListener(BudgetListener listener)
Add a listener for events that affect the budget list or the budgets in the list.
-
removeListener
public void removeListener(BudgetListener listener)
Removeo a listener for events that affect the budget list or the budgets in the list.
-
getAllBudgets
public java.util.List<Budget> getAllBudgets()
-
getBudgetWithKey
public Budget getBudgetWithKey(java.lang.String key)
Get the budget with the given key, if any
-
getBudgetWithID
public Budget getBudgetWithID(java.lang.String budgetID)
Get the budget with the given key, if any
-
findCurrentBudget
public Budget 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
null
if there are none.
-
removeBudget
public boolean removeBudget(Budget budget)
Remove the given budget from the list. Returns true if the budget was in the list.
-
addBudget
public void addBudget(Budget budget)
Create a new budget, add it to the list, and return it
-
containsBudgetWithName
public boolean containsBudgetWithName(java.lang.String budgetName)
-
-