Class CSVCurveParser


  • public class CSVCurveParser
    extends Object
    Provides options to parse curves.
    Author:
    Roland Bachl
    • Constructor Detail

      • CSVCurveParser

        public CSVCurveParser()
        Set up the parser with default interpolation.
        • InterpolationMethod.LINEAR
        • ExtrapolationMethod.CONSTANT
        • InterpolationEntity.LOG_OF_VALUE_PER_TIME
    • Method Detail

      • parseCSV

        public DiscountCurve parseCSV​(File file,
                                      String currency,
                                      String index)
                               throws IOException
        Extract a single discount curve from a csv file.
        Parameters:
        file - The file to be parsed.
        currency - The currency of the curve.
        index - The index of the curve.
        Returns:
        The discount curve.
        Throws:
        IOException - Thrown upon an exception related to File.
      • parseZIP

        public DiscountCurve[] parseZIP​(File file,
                                        String currency,
                                        String index)
                                 throws IOException
        Extract an arry of discount curves from a zip archive.
        Parameters:
        file - The archive to be parsed.
        currency - The currency of the curves.
        index - The index of the curves.
        Returns:
        The array of discount curves.
        Throws:
        IOException - Thrown upon an exception related to File.
      • getReferenceDates

        public static LocalDate[] getReferenceDates​(Curve[] curves)
        Extract the reference date of each curve in an array.
        Parameters:
        curves - The array of curves.
        Returns:
        Array of the respective reference dates.