Class PeriodicityHelper


  • public class PeriodicityHelper
    extends Object
    Helper class for periodicity related calculations.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • PeriodicityHelper

        public PeriodicityHelper()
    • Method Detail

      • getProperties

        protected static Properties getProperties()
        Returns the properties.
        Returns:
        the properties
      • calculateYearly

        protected static gnu.trove.list.array.TDoubleArrayList calculateYearly​(double left,
                                                                               Date leftDate,
                                                                               Calendar leftCal,
                                                                               double right,
                                                                               Date rightDate,
                                                                               Calendar rightCal)
        Calculates the yearly values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculateQuarterly

        protected static gnu.trove.list.array.TDoubleArrayList calculateQuarterly​(double left,
                                                                                  Date leftDate,
                                                                                  Calendar leftCal,
                                                                                  double right,
                                                                                  Date rightDate,
                                                                                  Calendar rightCal)
        Calculates the quarterly values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculateMonthly

        protected static gnu.trove.list.array.TDoubleArrayList calculateMonthly​(double left,
                                                                                Date leftDate,
                                                                                Calendar leftCal,
                                                                                double right,
                                                                                Date rightDate,
                                                                                Calendar rightCal)
        Calculates the monthly values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculateWeekly

        protected static gnu.trove.list.array.TDoubleArrayList calculateWeekly​(double left,
                                                                               Date leftDate,
                                                                               Calendar leftCal,
                                                                               double right,
                                                                               Date rightDate,
                                                                               Calendar rightCal)
        Calculates the weekly values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculateDaily

        protected static gnu.trove.list.array.TDoubleArrayList calculateDaily​(double left,
                                                                              Date leftDate,
                                                                              Calendar leftCal,
                                                                              double right,
                                                                              Date rightDate,
                                                                              Calendar rightCal)
        Calculates the daily values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculateHalfDaily

        protected static gnu.trove.list.array.TDoubleArrayList calculateHalfDaily​(double left,
                                                                                  Date leftDate,
                                                                                  Calendar leftCal,
                                                                                  double right,
                                                                                  Date rightDate,
                                                                                  Calendar rightCal)
        Calculates the half-daily values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculateHourly

        protected static gnu.trove.list.array.TDoubleArrayList calculateHourly​(double left,
                                                                               Date leftDate,
                                                                               Calendar leftCal,
                                                                               double right,
                                                                               Date rightDate,
                                                                               Calendar rightCal)
        Calculates the hourly values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculateHalfHourly

        protected static gnu.trove.list.array.TDoubleArrayList calculateHalfHourly​(double left,
                                                                                   Date leftDate,
                                                                                   Calendar leftCal,
                                                                                   double right,
                                                                                   Date rightDate,
                                                                                   Calendar rightCal)
        Calculates the half-hourly values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculatePerMinute

        protected static gnu.trove.list.array.TDoubleArrayList calculatePerMinute​(double left,
                                                                                  Date leftDate,
                                                                                  Calendar leftCal,
                                                                                  double right,
                                                                                  Date rightDate,
                                                                                  Calendar rightCal)
        Calculates the per minute values.
        Parameters:
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • calculate

        public static gnu.trove.list.array.TDoubleArrayList calculate​(PeriodicityType type,
                                                                      double left,
                                                                      Date leftDate,
                                                                      Calendar leftCal,
                                                                      double right,
                                                                      Date rightDate,
                                                                      Calendar rightCal)
        Calculates the per periodicity values.
        Parameters:
        type - the type of periodicity to calculate
        left - the left-most value
        leftDate - the left-most date
        leftCal - the calendar for the left-most date
        right - the right-most value
        rightDate - the right-most date
        rightCal - the calendar for the right-most date
        Returns:
        the raw values
      • getFormat

        public static String getFormat​(PeriodicityType type)
        Returns the format associated with the periodicity type.
        Parameters:
        type - the type of periodicity
        Returns:
        the associated type