Class OSHDBTimestamps

    • Constructor Detail

      • OSHDBTimestamps

        public OSHDBTimestamps​(String isoDateStart,
                               String isoDateEnd,
                               String isoPeriod,
                               boolean fromEnd)
        Creates regularly spaced timestamps between a start and end date by time intervals defined by an ISO 8601 "period" identifier.

        If fromEnd is true, the timestamps are computed starting with the end date, otherwise starting with the start date of the interval.

        Parameters:
        isoDateStart - ISO 8601 date string representing the start date
        isoDateEnd - ISO 8601 date string representing the start date
        isoPeriod - ISO 8601 time period string representing the interval between the generated timestamps
        fromEnd - computation of the timestamps starting with the end date of the interval (instead of the start date)
      • OSHDBTimestamps

        public OSHDBTimestamps​(String isoDateStart,
                               String isoDateEnd,
                               String isoPeriod)
        Creates regularly spaced timestamps between a start and end date by time intervals defined by an ISO 8601 "period" identifier.

        The timestamps are computed starting with the start date.

        Parameters:
        isoDateStart - ISO 8601 date string representing the start date
        isoDateEnd - ISO 8601 date string representing the start date
        isoPeriod - ISO 8601 time period string representing the interval between the generated timestamps
      • OSHDBTimestamps

        public OSHDBTimestamps​(String isoDateStart,
                               String isoDateEnd,
                               OSHDBTimestamps.Interval interval)
        Creates regularly spaced timestamps between a start and end date by predefined time intervals.

        The timestamps are computed starting with the start date.

        Parameters:
        isoDateStart - ISO 8601 date string representing the start date
        isoDateEnd - ISO 8601 date string representing the start date
        interval - interval between the generated timestamps
      • OSHDBTimestamps

        public OSHDBTimestamps​(String isoDateStart,
                               String isoDateEnd,
                               OSHDBTimestamps.Interval interval,
                               boolean fromEnd)
        Creates regularly spaced timestamps between a start and end date by predefined time intervals.

        If fromEnd is true, the timestamps are computed starting with the end date, otherwise starting with the start date of the interval.

        Parameters:
        isoDateStart - ISO 8601 date string representing the start date
        isoDateEnd - ISO 8601 date string representing the start date
        interval - interval between the generated timestamps
        fromEnd - computation of the timestamps starting with the end date of the interval (instead of the start date)
      • OSHDBTimestamps

        public OSHDBTimestamps​(String isoDateStart,
                               String isoDateEnd)
        Creates a "list" of two timestamps (consisting of a start and an end date).

        This can be used when one just wants to specify a single time interval without intermediate timestamps.

        Parameters:
        isoDateStart - ISO 8601 date string representing the start date
        isoDateEnd - ISO 8601 date string representing the start date
      • OSHDBTimestamps

        public OSHDBTimestamps​(String isoDate)
        Creates a "list" of a single timestamps (consisting of a only one specific date).

        This can be used when one just wants to specify a single time snapshot.

        Parameters:
        isoDate - ISO 8601 date string representing the date
    • Method Detail

      • get

        public SortedSet<OSHDBTimestamp> get()
        Provides the sorted list of (unix) timestamps representing this object's start/end date and interval.
        Specified by:
        get in interface OSHDBTimestampList
        Returns:
        a list of unix timestamps (measured in seconds)