Class Period

    • Field Detail

      • UNDEFINED

        public static final Period UNDEFINED
        Deprecated.
    • Constructor Detail

      • Period

        protected Period​(DateTime beginDatable,
                         DateTime endDatable)
        Deprecated.
        Constructor : Constructs a newly allocated period. TimeZone is set from the begin date of the period.
        Parameters:
        beginDatable - the date of the beginning of the period.
        endDatable - the date of the ending of the period.
      • Period

        protected Period​(DateTime beginDatable,
                         DateTime endDatable,
                         TimeZone timeZone)
        Deprecated.
        Constructor : Constructs a newly allocated period.
        Parameters:
        beginDatable - the date of the beginning of the period.
        endDatable - the date of the ending of the period.
        timeZone - the time zone to set to this period.
    • Method Detail

      • check

        public static Period check​(Period period)
        Deprecated.
        Checks if the specified period and returns the specified one if defined, or the common UNDEFINED otherwise.
        Parameters:
        period - the period
        Returns:
        the specified period is defined, the common UNDEFINED otherwise.
      • getPeriodWithUndefinedIfNull

        public static Period getPeriodWithUndefinedIfNull​(Date beginDate,
                                                          Date endDate)
        Deprecated.
        Initialize a period from given dates (undefined dates are taken into account for null ones). The treatment is trying to identify the type of the period (PeriodType).
        Parameters:
        beginDate - the date of the beginning of the period.
        endDate - the date of the ending of the period.
        Returns:
        the period between the two dates
      • from

        public static Period from​(Date beginDate,
                                  Date endDate)
        Deprecated.
        Initialize a period from given dates. The treatment is trying to identify the type of the period (PeriodType).
        Parameters:
        beginDate - the date of the beginning of the period.
        endDate - the date of the ending of the period.
        Returns:
        the period between the two dates
      • from

        public static Period from​(Date beginDate,
                                  Date endDate,
                                  TimeZone timeZone)
        Deprecated.
        Initialize a period from given dates. The treatment is trying to identify the type of the period (PeriodType).
        Parameters:
        beginDate - the date of the beginning of the period.
        endDate - the date of the ending of the period.
        timeZone - the time zone to set to this period.
        Returns:
        the period between the two dates
      • from

        public static Period from​(DateTime beginDatable,
                                  DateTime endDatable)
        Deprecated.
        Initialize a period from given dates. The treatment is trying to identify the type of the period (PeriodType).
        Parameters:
        beginDatable - the date of the beginning of the period.
        endDatable - the date of the ending of the period.
        Returns:
        the period between the two dates
      • from

        public static Period from​(Date referenceDate,
                                  PeriodType periodType)
        Deprecated.
        Initialize a period from a date and a type of period.
        Parameters:
        referenceDate - the date at which starts the period
        periodType - the type of the period
        Returns:
        the period
      • isDefined

        public boolean isDefined()
        Deprecated.
        Indicates if one of begin date or end date is defined.
        Returns:
        true if period is defined, false otherwise.
      • isNotDefined

        public boolean isNotDefined()
        Deprecated.
        Indicates the opssite of isDefined().
        Returns:
        true if period is not defined, false otherwise.
      • inTimeZone

        public Period inTimeZone​(TimeZone timeZone)
        Deprecated.
        The time zone for a period has no meaning.
        Parameters:
        timeZone - the time zone to set to this period.
        Returns:
        itself
      • getTimeZone

        public TimeZone getTimeZone()
        Deprecated.
        The time zone has no meaning for a date.
        Returns:
        the time zone in which this period is set.
      • getPeriodType

        public PeriodType getPeriodType()
        Deprecated.
        Gets the type of the period.
        Returns:
        the period type
      • setPeriodType

        protected void setPeriodType​(PeriodType periodType)
        Deprecated.
        Sets the type of the period.
        Parameters:
        periodType - the period type
      • getBeginDate

        public Date getBeginDate()
        Deprecated.
        Gets the begin date of the period. It represents the begin date of the event if no recurrence exists, or the begin date of the first occurence of the event if a recurrence exists.
        Returns:
        the beginning date
      • getEndDate

        public Date getEndDate()
        Deprecated.
        Gets the end date of the period.
        Returns:
        the ending date
      • getBeginDatable

        public DateTime getBeginDatable()
        Deprecated.
        Gets the begin date of the period represented as a Temporal. (see getBeginDate() for more details).
        Returns:
        the beginning date
      • getEndDatable

        public DateTime getEndDatable()
        Deprecated.
        Gets the end date of the period represented as a Temporal. (see getEndDate() for more details).
        Returns:
        the ending date
      • setDate

        public void setDate​(Date dateReference,
                            PeriodType periodType)
        Deprecated.
      • setDate

        public void setDate​(Date dateReference,
                            TimeZone timeZone,
                            PeriodType periodType)
        Deprecated.
      • setDate

        public void setDate​(DateTime referenceDatable,
                            PeriodType periodType)
        Deprecated.
      • setDates

        public void setDates​(Date beginDate,
                             Date endDate)
        Deprecated.
      • setDates

        public void setDates​(Date beginDate,
                             Date endDate,
                             TimeZone timeZone)
        Deprecated.
      • setDates

        public void setDates​(DateTime beginDatable,
                             DateTime endDatable)
        Deprecated.
      • getElapsedTimeData

        public Duration getElapsedTimeData()
        Deprecated.
        Computes the elapsed time between the begin and the end dates.
        Returns:
        the elapsed time computed represented by Duration. To retrieve informations from this returned object :
           // Gets the elpased time in milliseconds
        period.getElapsedTimeData().getTime();

        // Gets the elpased time in seconds
        period.getElapsedTimeData().getTimeConverted(TimeUnit.SEC);

        // Gets the elpased time in years
        period.getElapsedTimeData().getTimeConverted(TimeUnit.YEAR);

        ...
        // Gets the elpased time in the best unit value
        period.getElapsedTimeData().getBestValue();
      • getCoveredDaysTimeData

        public Duration getCoveredDaysTimeData()
        Deprecated.
        Computes the number of whole or partial days covered by the period.
        Returns:
        the number of whole or partial days covered by the period. represented by Duration. To retrieve informations from this returned object :
           // Gets the number of days (in milliseconds)
        period.getCoveredDaysTimeData().getTime();

        // Gets the number of days (in days)
        period.getCoveredDaysTimeData().getTimeConverted(TimeUnit.DAY);

        ...
        // Gets the number of days (in best unit value)
        period.getCoveredDaysTimeData().getBestValue();
      • compareTo

        public int compareTo​(Period period)
        Deprecated.
        The comparison is at first time executed on the begin dates. If they are equals, then it is executed on the end dates.
        Parameters:
        period - the period
        Returns:
        the comparison result
      • isLongerThan

        public boolean isLongerThan​(Period period)
        Deprecated.
      • equals

        public boolean equals​(Object o)
        Deprecated.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object
      • isValid

        public boolean isValid()
        Deprecated.
      • formatPeriodForTests

        protected String formatPeriodForTests()
        Deprecated.
      • contains

        public boolean contains​(Date date)
        Deprecated.
        Checks if the given date is included in the period.
        Parameters:
        date - a date
        Returns:
        true if the given date is included in the period.
      • contains

        public boolean contains​(Period period)
        Deprecated.
        Checks if the given period is included in the period.
        Parameters:
        period - a period
        Returns:
        true if the given period is included in the period.
      • containsPartOf

        public boolean containsPartOf​(Period period)
        Deprecated.
        Checks if the given period is partially included in the period.
        Parameters:
        period - Une date
        Returns:
        true if the given period is partially included in the period.