org.homeunix.thecave.buddi.plugin.api.model
Interface ImmutableDocument

All Superinterfaces:
java.lang.Comparable<ImmutableModelObject>, ImmutableModelObject
All Known Subinterfaces:
MutableDocument
All Known Implementing Classes:
ImmutableDocumentImpl, MutableDocumentImpl

public interface ImmutableDocument
extends ImmutableModelObject

The API version of DataModel. This contains methods to access all other objects in the model. This is the object passed to plugins which do not require write access (such as reports and export plugins)

Author:
wyatt

Method Summary
 ImmutableAccount getAccount(java.lang.String name)
          Returns the account referenced by the given name.
 ImmutableAccountType getAccountType(java.lang.String name)
          Returns the type referenced by the given name.
 ImmutableBudgetCategory getBudgetCategory(java.lang.String fullName)
          Returns the budget category referenced by the given full name.
 ImmutableBudgetCategoryType getBudgetCategoryType(BudgetCategoryTypes name)
          Returns an ImmutableBudgetCategoryType object, with the given name.
 ImmutableBudgetCategoryType getBudgetCategoryType(java.lang.String name)
          Returns an ImmutableBudgetCategoryType object, with the given name.
 java.util.List<ImmutableAccount> getImmutableAccounts()
          Returns a list of all immutable accounts in the model
 java.util.List<ImmutableAccountType> getImmutableAccountTypes()
          Returns a list of all immutable types in the model
 java.util.List<ImmutableBudgetCategory> getImmutableBudgetCategories()
          Returns a list of all immutable budget categories in the model
 java.util.List<ImmutableTransaction> getImmutableTransactions()
          Returns a list of all immutable transactions in the model
 java.util.List<ImmutableTransaction> getImmutableTransactions(java.util.Date startDate, java.util.Date endDate)
          Returns a list of all immutable transactions in the model which are between startDate and endDate
 java.util.List<ImmutableTransaction> getImmutableTransactions(ImmutableSource source)
          Returns a list of all immutable transactions in the model which are associatd with the given source
 java.util.List<ImmutableTransaction> getImmutableTransactions(ImmutableSource source, java.util.Date startDate, java.util.Date endDate)
          Returns a list of all immutable transactions in the model which are associated with source and between startDate and endDate
 Document getModel()
          Returns the wrapped object from the underlying data model.
 long getNetWorth(java.util.Date date)
          Returns the net worth in the model as of the given date.
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableModelObject
getModified, getRaw, getUid
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getAccount

ImmutableAccount getAccount(java.lang.String name)
Returns the account referenced by the given name.

Parameters:
name -
Returns:

getImmutableAccounts

java.util.List<ImmutableAccount> getImmutableAccounts()
Returns a list of all immutable accounts in the model

Returns:

getImmutableBudgetCategories

java.util.List<ImmutableBudgetCategory> getImmutableBudgetCategories()
Returns a list of all immutable budget categories in the model

Returns:

getBudgetCategory

ImmutableBudgetCategory getBudgetCategory(java.lang.String fullName)
Returns the budget category referenced by the given full name.

Parameters:
fullName -
Returns:

getModel

Document getModel()
Returns the wrapped object from the underlying data model. By accessing this method, you bypass all protection which the Buddi API gives you; it is not recommended to use this method unless you understand the risks associated with it.

Returns:

getImmutableTransactions

java.util.List<ImmutableTransaction> getImmutableTransactions()
Returns a list of all immutable transactions in the model

Returns:

getImmutableTransactions

java.util.List<ImmutableTransaction> getImmutableTransactions(java.util.Date startDate,
                                                              java.util.Date endDate)
Returns a list of all immutable transactions in the model which are between startDate and endDate

Returns:

getImmutableTransactions

java.util.List<ImmutableTransaction> getImmutableTransactions(ImmutableSource source)
Returns a list of all immutable transactions in the model which are associatd with the given source

Returns:

getImmutableTransactions

java.util.List<ImmutableTransaction> getImmutableTransactions(ImmutableSource source,
                                                              java.util.Date startDate,
                                                              java.util.Date endDate)
Returns a list of all immutable transactions in the model which are associated with source and between startDate and endDate

Returns:

getAccountType

ImmutableAccountType getAccountType(java.lang.String name)
Returns the type referenced by the given name.

Parameters:
name -
Returns:

getImmutableAccountTypes

java.util.List<ImmutableAccountType> getImmutableAccountTypes()
Returns a list of all immutable types in the model

Returns:

getBudgetCategoryType

ImmutableBudgetCategoryType getBudgetCategoryType(BudgetCategoryTypes name)
Returns an ImmutableBudgetCategoryType object, with the given name. If the name is not a valid one, returns null.

Parameters:
name -
Returns:

getBudgetCategoryType

ImmutableBudgetCategoryType getBudgetCategoryType(java.lang.String name)
Returns an ImmutableBudgetCategoryType object, with the given name. If the name is not a valid one, returns null. Although this method gives the same results as the other one, given the same input, it is recommeneded to use the one which takes an enum if possible. That will ensure that you do not make any mistakes with spelling, which may cause a null to be returned.

Parameters:
name -
Returns:

getNetWorth

long getNetWorth(java.util.Date date)
Returns the net worth in the model as of the given date. This is calculated by summing the account balances for all accounts as of the given date. If the given date is null, return the current balance of the account, as of the last transaction (regardless of date).

Parameters:
date - The date on which to calculate the net worth. Set this to null to return the balance as of the last transaction.
Returns: