com.moneydance.apps.md.model
Class Budget

java.lang.Object
  extended by com.moneydance.apps.md.model.Budget

public final class Budget
extends java.lang.Object

Represents one item in a budget


Constructor Summary
Budget(BudgetList list, RootAccount root)
          Construct a new budget in the context of the given account.
Budget(BudgetList list, RootAccount root, java.lang.String key, StreamTable info)
           
 
Method Summary
 Budget cloneBudget()
          Create a copy of this budget
 BudgetItem createItem()
          Create a new item, add it to the list, and return it
 BudgetList getBudgetList()
          Return the list that contains this budget
 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
 java.lang.String getKey()
          Return the unique key needed to identify this budget for storage
 java.lang.String getName()
          Get the name of this budget
 int indexOf(BudgetItem item)
          Return the position in the item list of the given item
 boolean removeItem(BudgetItem item)
          Remove the given budget item from the list.
 void setBudgetInfo(Budget budget)
          Copies the information from the given budget into this budget.
 void setName(java.lang.String newName)
          Set the name for this budget
 void sortItems()
          Sort the list of budgets
 BudgetItem[] toArray()
          Get a new array of the budget items contained in this list
 java.lang.String toString()
          Return the string representation of this budget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Budget

public Budget(BudgetList list,
              RootAccount root)
Construct a new budget in the context of the given account. This budget will also need to be added to the list using the BudgetList.addBudget() method.


Budget

public Budget(BudgetList list,
              RootAccount root,
              java.lang.String key,
              StreamTable info)
Method Detail

setBudgetInfo

public void setBudgetInfo(Budget budget)
Copies the information from the given budget into this budget. This is most useful for applying changes from a "working copy" of a budget. A working copy can be obtained by calling cloneBudget().


cloneBudget

public Budget cloneBudget()
Create a copy of this budget


getKey

public final java.lang.String getKey()
Return the unique key needed to identify this budget for storage


getBudgetList

public final BudgetList getBudgetList()
Return the list that contains this budget


sortItems

public final void sortItems()
Sort the list of budgets


getName

public java.lang.String getName()
Get the name of this budget


setName

public void setName(java.lang.String newName)
Set the name for this budget


getItemCount

public int getItemCount()
Get the number of items in this budget


getItem

public BudgetItem getItem(int i)
Get the budget item at the given position in the list


toArray

public BudgetItem[] toArray()
Get a new array of the budget items contained in this list


removeItem

public boolean removeItem(BudgetItem item)
Remove the given budget item from the list. Returns true if the item was in the list.


indexOf

public int indexOf(BudgetItem item)
Return the position in the item list of the given item


createItem

public BudgetItem createItem()
Create a new item, add it to the list, and return it


toString

public java.lang.String toString()
Return the string representation of this budget

Overrides:
toString in class java.lang.Object