Class DefaultPeriod

java.lang.Object
be.gaudry.model.date.DefaultPeriod
All Implemented Interfaces:
IPeriod

public class DefaultPeriod extends Object implements IPeriod
Basic implementation of a period. Provided by the broldev.core.model project.
Since:
1.1 Mar 02, 2009, broldev.core.model 0.0.1-SNAPSHOT dependency
Version:
1.0 Jan 30, 2009
Author:
Steph GAUDRY
  • Field Details

    • startDate

      protected Date startDate
    • endDate

      protected Date endDate
    • dateFormat

      protected DateFormat dateFormat
  • Constructor Details

    • DefaultPeriod

      public DefaultPeriod()
      Builds a default period with a start date and an end date set to now.
    • DefaultPeriod

      public DefaultPeriod(Date startDate, Date endDate)
      Builds a period with a start date and an end date
      Parameters:
      startDate -
      endDate -
  • Method Details

    • getIntervalString

      public String getIntervalString()
      Localized String representation of the DefaultPeriod like this:
      • from ? to MM/dd/YY
      • from MM/dd/YY to MM/dd/YY
      • du dd/MM/YY au dd/MM/YY
      • du dd/MM/YY au ?
      \nTODO internationalize this
      Specified by:
      getIntervalString in interface IPeriod
      Returns:
      the IPeriod String representation
      See Also:
      getDateFormat(), IPeriod.getIntervalString()
    • getStartDate

      public Date getStartDate()
      Description copied from interface: IPeriod
      The date when the IPeriod starts.
      Specified by:
      getStartDate in interface IPeriod
      Returns:
      the startDate
    • setStartDate

      public void setStartDate(Date startDate)
      Specified by:
      setStartDate in interface IPeriod
      Parameters:
      startDate - the startDate to set
      See Also:
      IPeriod.getStartDate()
    • getEndDate

      public Date getEndDate()
      Description copied from interface: IPeriod
      The date when the IPeriod stops.
      Specified by:
      getEndDate in interface IPeriod
      Returns:
      the endDate
    • setEndDate

      public void setEndDate(Date endDate)
      Specified by:
      setEndDate in interface IPeriod
      Parameters:
      endDate - the endDate to set
      See Also:
      IPeriod.getEndDate()
    • getDateFormat

      @Deprecated public DateFormat getDateFormat()
      Deprecated.
      since 1.1\nIn the future versions, the date format will be red from user preferences
      Gets the date format to use to display the start date and the end date.
      Returns:
      the dateFormat
    • setDateFormat

      @Deprecated public void setDateFormat(DateFormat dateFormat)
      Deprecated.
      since 1.1\nIn the future versions, the date format will be red from user preferences
      Parameters:
      dateFormat - the dateFormat to set
      See Also:
      getDateFormat()