Class SeasonalityDefinitionCsvLoader


  • public final class SeasonalityDefinitionCsvLoader
    extends Object
    Loads a set of seasonality definitions into memory by reading from CSV resources.

    The CSV file has the following header row:
    Curve Name,Shift Type,Jan-Feb,Feb-Mar,Mar-Apr,Apr-May,May-Jun,Jun-Jul,Jul-Aug,Aug-Sep,Sep-Oct,Oct-Nov,Nov-Dec,Dec-Jan.

    • The 'Curve Name' column is the name of the curve.
    • The 'Shift Type' column is the type of the shift, "Scaled" (multiplicative) or "Absolute" (additive).
    • The 'Jan-Feb' and similar columns are the seasonality values month-on-month.

    CSV files sometimes contain a Unicode Byte Order Mark. Callers are responsible for handling this, such as by using UnicodeBom.

    • Method Detail

      • loadSeasonalityDefinitions

        public static Map<CurveName,​SeasonalityDefinition> loadSeasonalityDefinitions​(ResourceLocator resource)
        Loads the seasonality definition CSV file.
        Parameters:
        resource - the seasonality CSV resource
        Returns:
        the map of seasonality definitions
      • parseSeasonalityDefinitions

        public static Map<CurveName,​SeasonalityDefinition> parseSeasonalityDefinitions​(CharSource charSource)
        Parses the seasonality definition CSV file.
        Parameters:
        charSource - the seasonality CSV character source
        Returns:
        the map of seasonality definitions