public class BudgetItemList extends java.lang.Object implements java.lang.Iterable<BudgetItem>
Constructor and Description |
---|
BudgetItemList(Budget budget) |
BudgetItemList(Budget budget,
java.util.List<BudgetItem> itemList) |
Modifier and Type | Method and Description |
---|---|
BudgetItem |
createItem() |
long |
getActualAmount(Account account,
BudgetPeriod budgetPeriod)
Return the actual amount for a specific category in a month.
|
long |
getActualAmountForAllCategoriesInPeriod(BudgetPeriod budgetPeriod,
CurrencyType resultCurrency)
Returns the actual amount for all categories in a month.
|
Budget |
getBudget() |
long |
getBudgetedAmount(Account account,
BudgetPeriod budgetPeriod)
Return the budgeted amount for a specific category in a month.
|
long |
getBudgetedAmountForAllCategoriesInPeriod(BudgetPeriod budgetPeriod)
Returns the budgeted amount for all categories in the given period
|
BudgetItem |
getBudgetItemForCategory(Account account,
BudgetPeriod budgetPeriod)
Get the budget items for the given account in the given budget period.
|
java.util.List<BudgetItem> |
getBudgetItemsForAccountAndInterval(Account account,
int interval) |
java.util.ArrayList<BudgetItem> |
getBudgetItemsForAccountInRange(Account account,
DateRange dateRange,
java.util.ArrayList<BudgetItem> budgetItems)
Get the budget items with the given transfer account whose date interval
overlap with the given date range.
|
BudgetItem |
getItem(int i)
Get the budget item at the given position in the list
|
int |
getItemCount()
Get the number of items in this budget
|
int |
indexOf(BudgetItem item)
Return the position in the item list of the given item
|
java.util.Iterator<BudgetItem> |
iterator() |
static BudgetItemList |
makeEditableList(Budget budget) |
BudgetItemList |
makeEditingCopy() |
void |
reload()
Reload by rescanning the data model for budget items.
|
boolean |
removeItem(BudgetItem item)
Remove the given budget item from the list.
|
void |
saveEdits() |
void |
setBudgetedAmount(Account account,
long amount,
BudgetPeriod budgetPeriod)
Sets the budgeted amount for a given Account in a given BudgetPeriod.
|
void |
sortItems() |
BudgetItem[] |
toArray()
Get a new array of the budget items contained in this list
|
public BudgetItemList(Budget budget, java.util.List<BudgetItem> itemList)
public BudgetItemList(Budget budget)
public void reload()
public BudgetItemList makeEditingCopy()
public static BudgetItemList makeEditableList(Budget budget)
public void saveEdits()
public Budget getBudget()
public void sortItems()
public int getItemCount()
public BudgetItem getItem(int i)
public BudgetItem[] toArray()
public boolean removeItem(BudgetItem item)
public int indexOf(BudgetItem item)
public java.util.Iterator<BudgetItem> iterator()
iterator
in interface java.lang.Iterable<BudgetItem>
public BudgetItem getBudgetItemForCategory(Account account, BudgetPeriod budgetPeriod)
account
- budgetPeriod
- public java.util.List<BudgetItem> getBudgetItemsForAccountAndInterval(Account account, int interval)
account
- interval
- public java.util.ArrayList<BudgetItem> getBudgetItemsForAccountInRange(Account account, DateRange dateRange, java.util.ArrayList<BudgetItem> budgetItems)
account
- the account (category) for itemsdateRange
- the date range to search for matching itemsbudgetItems
- an empty ArrayList to which the matching items should be added. or null.public long getBudgetedAmount(Account account, BudgetPeriod budgetPeriod)
account
- the account (category) for itemsbudgetPeriod
- the budget periodpublic long getActualAmount(Account account, BudgetPeriod budgetPeriod)
account
- budgetPeriod
- public long getActualAmountForAllCategoriesInPeriod(BudgetPeriod budgetPeriod, CurrencyType resultCurrency)
budgetPeriod
- the budget period to gather amounts forpublic long getBudgetedAmountForAllCategoriesInPeriod(BudgetPeriod budgetPeriod)
budgetPeriod
- public void setBudgetedAmount(Account account, long amount, BudgetPeriod budgetPeriod)
account
- amount
- budgetPeriod
- public BudgetItem createItem()