Class NumberByDateAggregator


public final class NumberByDateAggregator extends AbstractNumberAggregator<Date,SumByDateAggregatorBucket>
This class can be used to aggregate numbers while grouping them by date intervals.
  • Constructor Details

    • NumberByDateAggregator

      public NumberByDateAggregator(String p_strMode, TimeZone p_tz)
      Create an aggregator for date/time values.

      The following aggregation modes are supported:

      • year: by year
      • month: by month
      • day: by day
      • hour: by hour
      • minute: by minute
      • second: by second
      • millisecond: (should normally not be used)
      • quarter: by quarter
      • week: by start of the week

      Parameters:
      p_strMode - The mode used for aggregation.
      p_tz - The time zone.
  • Method Details

    • getFirstDayOfWeek

      public int getFirstDayOfWeek()
      Get the day the week starts with.
      Returns:
      1 for Sunday, 2 for Monday, ..., 7 for Saturday.
    • setFirstDayOfWeek

      public void setFirstDayOfWeek(int p_iFirstDayOfWeek)
      Set the day the week starts with.
      Parameters:
      p_iFirstDayOfWeek - The day the weeks starts with (1 for Sunday, 2 for Monday, ..., 7 for Saturday).
    • getAggregatedValues

      Get an ascendingly ordered list of aggregated values.
      Specified by:
      getAggregatedValues in class AbstractNumberAggregator<Date,SumByDateAggregatorBucket>
      Returns:
      The list of aggregated values.
    • add

      public void add(Date p_dt, String p_strRow, Number p_value, String p_strSingleId)
      Add an observation.
      Parameters:
      p_dt - The "category" value, i.e. the time of the observation.
      p_strRow - The row value.
      p_value - The value.
      p_strSingleId - A an identifier that is being stored as long as there is exactly one such identifier for a group (normally a record ID).