Class BudgetPeriod


  • public class BudgetPeriod
    extends java.lang.Object
    Represents the date range on which the budget calculations are based upon.
    See Also:
    PeriodType
    • 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 class java.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)