org.homeunix.thecave.buddi.plugin.api.model.impl
Class ImmutableBudgetCategoryImpl

java.lang.Object
  extended by org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableModelObjectImpl
      extended by org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableSourceImpl
          extended by org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableBudgetCategoryImpl
All Implemented Interfaces:
java.lang.Comparable<ImmutableModelObject>, ImmutableBudgetCategory, ImmutableModelObject, ImmutableSource

public class ImmutableBudgetCategoryImpl
extends ImmutableSourceImpl
implements ImmutableBudgetCategory


Constructor Summary
ImmutableBudgetCategoryImpl(BudgetCategory budgetCategory)
           
 
Method Summary
 java.util.List<ImmutableBudgetCategory> getAllImmutableChildren()
          Returns all children of this budget category, regardless of delete flag state.
 long getAmount(java.util.Date date)
          Returns the budgeted amount for the given date.
 long getAmount(java.util.Date startDate, java.util.Date endDate)
          Returns the budgeted amount spread across the date range.
 BudgetCategory getBudgetCategory()
          Returns the wrapped object from the underlying data model.
 java.util.List<java.util.Date> getBudgetedDates()
          Returns a list of all dates for this budget period which have budget information set for them.
 ImmutableBudgetCategoryType getBudgetPeriodType()
          Returns the budget period type associated with this budget category.
 java.util.List<ImmutableBudgetCategory> getImmutableChildren()
          Returns all visible children of this budget category.
 ImmutableBudgetCategory getParent()
          Returns the parent of this ImmutableBudgetCategory, or null if there is no parent.
 boolean isIncome()
          Does this ImmutableBudgetCategory represent an income category?
 java.lang.String toString()
           
 
Methods inherited from class org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableSourceImpl
getFullName, getName, getNotes, getSource, isDeleted
 
Methods inherited from class org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableModelObjectImpl
compareTo, equals, getModified, getRaw, getUid, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableSource
getFullName, getName, getNotes, getSource, isDeleted
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableModelObject
getModified, getRaw, getUid
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

ImmutableBudgetCategoryImpl

public ImmutableBudgetCategoryImpl(BudgetCategory budgetCategory)
Method Detail

isIncome

public boolean isIncome()
Description copied from interface: ImmutableBudgetCategory
Does this ImmutableBudgetCategory represent an income category?

Specified by:
isIncome in interface ImmutableBudgetCategory
Returns:

getParent

public ImmutableBudgetCategory getParent()
Description copied from interface: ImmutableBudgetCategory
Returns the parent of this ImmutableBudgetCategory, or null if there is no parent.

Specified by:
getParent in interface ImmutableBudgetCategory
Returns:

getBudgetCategory

public BudgetCategory getBudgetCategory()
Description copied from interface: ImmutableBudgetCategory
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.

Specified by:
getBudgetCategory in interface ImmutableBudgetCategory
Returns:

getAmount

public long getAmount(java.util.Date startDate,
                      java.util.Date endDate)
Description copied from interface: ImmutableBudgetCategory
Returns the budgeted amount spread across the date range. For instance, given a monthly budget period, and the date range Sept 15 - Sept 30, and September had a value of 100 for the given budget category, we would return 50.

Specified by:
getAmount in interface ImmutableBudgetCategory
Returns:

getAmount

public long getAmount(java.util.Date date)
Description copied from interface: ImmutableBudgetCategory
Returns the budgeted amount for the given date.

Specified by:
getAmount in interface ImmutableBudgetCategory
Returns:

getBudgetPeriodType

public ImmutableBudgetCategoryType getBudgetPeriodType()
Description copied from interface: ImmutableBudgetCategory
Returns the budget period type associated with this budget category.

Specified by:
getBudgetPeriodType in interface ImmutableBudgetCategory
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class ImmutableSourceImpl

getAllImmutableChildren

public java.util.List<ImmutableBudgetCategory> getAllImmutableChildren()
Description copied from interface: ImmutableBudgetCategory
Returns all children of this budget category, regardless of delete flag state.

Specified by:
getAllImmutableChildren in interface ImmutableBudgetCategory
Returns:

getImmutableChildren

public java.util.List<ImmutableBudgetCategory> getImmutableChildren()
Description copied from interface: ImmutableBudgetCategory
Returns all visible children of this budget category. 'Visible Children' are defined to be all children which do not have the deleted flag set, plus all children which have the deleted flag set IIF the Preferences define that the user wants to see deleted sources. This method is mostly used for GUI functions, such as reports and graphs; if you want to access the model it is usually a better idea to use the getAllChildren() method, which will return all children regardless of delete flag state.

Specified by:
getImmutableChildren in interface ImmutableBudgetCategory
Returns:

getBudgetedDates

public java.util.List<java.util.Date> getBudgetedDates()
Description copied from interface: ImmutableBudgetCategory
Returns a list of all dates for this budget period which have budget information set for them. Any date for this budget period which has an associated amount of anything other than zero will be returned here.

Specified by:
getBudgetedDates in interface ImmutableBudgetCategory
Returns: