org.homeunix.thecave.buddi.model.impl
Class BudgetCategoryTypeMonthly

java.lang.Object
  extended by org.homeunix.thecave.buddi.model.BudgetCategoryType
      extended by org.homeunix.thecave.buddi.model.impl.BudgetCategoryTypeMonthly

public class BudgetCategoryTypeMonthly
extends BudgetCategoryType

Definition of a Monthly BudgetCategoryType.

Author:
wyatt

Constructor Summary
BudgetCategoryTypeMonthly()
           
 
Method Summary
 java.util.Date getBudgetPeriodOffset(java.util.Date date, int offset)
          Method to move forwards or backwards by the given number of periods.
 java.lang.String getDateFormat()
          Returns the date format associated with this budget period type.
 long getDaysInPeriod(java.util.Date date)
          Returns the number of days in the period specified by date.
 java.util.Date getEndOfBudgetPeriod(java.util.Date date)
          Returns the end of the budget period which contains the given date.
 java.lang.String getName()
          Returns the name of this budget period.
 java.util.Date getStartOfBudgetPeriod(java.util.Date date)
          Returns the start of the budget period which contains the given date.
 
Methods inherited from class org.homeunix.thecave.buddi.model.BudgetCategoryType
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BudgetCategoryTypeMonthly

public BudgetCategoryTypeMonthly()
Method Detail

getStartOfBudgetPeriod

public java.util.Date getStartOfBudgetPeriod(java.util.Date date)
Description copied from class: BudgetCategoryType
Returns the start of the budget period which contains the given date.

Specified by:
getStartOfBudgetPeriod in class BudgetCategoryType
Returns:

getEndOfBudgetPeriod

public java.util.Date getEndOfBudgetPeriod(java.util.Date date)
Description copied from class: BudgetCategoryType
Returns the end of the budget period which contains the given date.

Specified by:
getEndOfBudgetPeriod in class BudgetCategoryType
Returns:

getBudgetPeriodOffset

public java.util.Date getBudgetPeriodOffset(java.util.Date date,
                                            int offset)
Description copied from class: BudgetCategoryType
Method to move forwards or backwards by the given number of periods. This must conform to the following statements: If offset is 0, return the same date If offset is positive, add that many budget periods. For instance, if the value 3 is given, MONTHLY period is selected, and the current date is August 1, the return date will be November 1 (August + 3). If offset is negative, subtract that many budget periods. The inverse of this must be the same as positive; for instance, if you are given a date and you add '-3' to it, and then add '3' again, you must arrive at the same date as you started with.

Specified by:
getBudgetPeriodOffset in class BudgetCategoryType
Returns:

getDaysInPeriod

public long getDaysInPeriod(java.util.Date date)
Description copied from class: BudgetCategoryType
Returns the number of days in the period specified by date. The given date can be any date within the budget period. For instance, if this class defines a Monthly type, passing in a date of August 4 2007 would return the value 31; passing in the date of September 20 2009 would return the value 30.

Specified by:
getDaysInPeriod in class BudgetCategoryType
Returns:

getDateFormat

public java.lang.String getDateFormat()
Description copied from class: BudgetCategoryType
Returns the date format associated with this budget period type. This is used in the My Budgets window to format the date spinner and the column names. For information on how to display the format, please see the SimpleDateFormatter javadocs. For instance, for Monthly type, the value would be "MMM yyyy" (to show Aug 2007). For the Weekly type, since we want to show days as well, the format would be "dd MMM yyyy".

Specified by:
getDateFormat in class BudgetCategoryType
Returns:

getName

public java.lang.String getName()
Description copied from class: BudgetCategoryType
Returns the name of this budget period. It will be filtered through the translator before displaying it, do this can be a translation key if desired.

Specified by:
getName in class BudgetCategoryType
Returns: