Class BudgetPeriod
- java.lang.Object
-
- com.infinitekind.moneydance.model.BudgetPeriod
-
public class BudgetPeriod extends java.lang.Object
Represents the date range on which the budget calculations are based upon.- See Also:
PeriodType
-
-
Constructor Summary
Constructors Constructor Description BudgetPeriod(int startDate, PeriodType periodType)
BudgetPeriod(java.util.Date startDate, PeriodType periodType)
Deprecated.please use the BudgetPeriod(int startDate, PeriodType periodType) constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(BudgetItem item)
Check whether a BudgetItem interval is fully contained in a BudgetPeriod.static int
getBudgetIntervalForPeriodType(PeriodType periodType)
DateRange
getDateRange()
Return the date range encompassed by the BudgetPeriod.java.lang.String
getDescription()
int
getEndDate()
BudgetPeriod
getNextBudgetPeriod()
Returns a new BudgetPeriod object representing the budget period following the current one.PeriodType
getPeriodType()
static PeriodType
getPeriodTypeForBudgetInterval(int interval)
Return the PeriodType that corresponds to the given budget item interval.BudgetPeriod
getPreviousBudgetPeriod()
Returns a new BudgetPeriod object representing the budget period preceding the current one.int
getStartDate()
boolean
overlap(BudgetItem item)
Check whether a BudgetItem interval is partially contained in a BudgetPeriod or vice versa.void
setPeriodType(PeriodType periodType)
Set the new PeriodType and recalculate the date range.void
setStartDate(int date)
Set the start date and recalculate the end date.java.lang.String
toString()
-
-
-
Constructor Detail
-
BudgetPeriod
public BudgetPeriod(java.util.Date startDate, PeriodType periodType)
Deprecated.please use the BudgetPeriod(int startDate, PeriodType periodType) constructor
-
BudgetPeriod
public BudgetPeriod(int startDate, PeriodType periodType)
-
-
Method Detail
-
setPeriodType
public void setPeriodType(PeriodType periodType)
Set the new PeriodType and recalculate the date range.- Parameters:
periodType
-
-
getPeriodType
public PeriodType getPeriodType()
-
getStartDate
public int getStartDate()
-
setStartDate
public void setStartDate(int date)
Set the start date and recalculate the end date.- Parameters:
date
-
-
getEndDate
public int getEndDate()
-
getDateRange
public DateRange getDateRange()
Return the date range encompassed by the BudgetPeriod.- Returns:
-
getDescription
public java.lang.String getDescription()
-
overlap
public boolean overlap(BudgetItem item)
Check whether a BudgetItem interval is partially contained in a BudgetPeriod or vice versa.- Parameters:
item
-- Returns:
-
contains
public boolean contains(BudgetItem item)
Check whether a BudgetItem interval is fully contained in a BudgetPeriod.- Parameters:
item
-- Returns:
-
getPreviousBudgetPeriod
public BudgetPeriod getPreviousBudgetPeriod()
Returns a new BudgetPeriod object representing the budget period preceding the current one.- Returns:
- BudgetPeriod
-
getNextBudgetPeriod
public BudgetPeriod getNextBudgetPeriod()
Returns a new BudgetPeriod object representing the budget period following the current one.- Returns:
- Date
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getPeriodTypeForBudgetInterval
public static PeriodType getPeriodTypeForBudgetInterval(int interval)
Return the PeriodType that corresponds to the given budget item interval.- Parameters:
interval
-- Returns:
-
getBudgetIntervalForPeriodType
public static int getBudgetIntervalForPeriodType(PeriodType periodType)
-
-