public class BudgetPeriod
extends java.lang.Object
PeriodType
Constructor and Description |
---|
BudgetPeriod(java.util.Date startDate,
PeriodType periodType) |
BudgetPeriod(int startDate,
PeriodType periodType) |
Modifier and Type | Method and 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.
|
public BudgetPeriod(java.util.Date startDate, PeriodType periodType)
public BudgetPeriod(int startDate, PeriodType periodType)
public void setPeriodType(PeriodType periodType)
periodType
- public PeriodType getPeriodType()
public int getStartDate()
public void setStartDate(int date)
date
- public int getEndDate()
public DateRange getDateRange()
public java.lang.String getDescription()
public boolean overlap(BudgetItem item)
item
- public boolean contains(BudgetItem item)
item
- public BudgetPeriod getPreviousBudgetPeriod()
public BudgetPeriod getNextBudgetPeriod()
public static PeriodType getPeriodTypeForBudgetInterval(int interval)
interval
- public static int getBudgetIntervalForPeriodType(PeriodType periodType)