- java.lang.Object
-
- net.finmath.parser.CSVCurveParser
-
public class CSVCurveParser extends Object
Provides options to parse curves.- Author:
- Roland Bachl
-
-
Constructor Summary
Constructors Constructor Description CSVCurveParser()
Set up the parser with default interpolation.CSVCurveParser(CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
Set up the parser with given interpolation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalDate[]
getReferenceDates(Curve[] curves)
Extract the reference date of each curve in an array.DiscountCurve
parseCSV(File file, String currency, String index)
Extract a single discount curve from a csv file.DiscountCurve[]
parseZIP(File file, String currency, String index)
Extract an arry of discount curves from a zip archive.void
setInterpolation(CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
Set interpolation method for parsed curves.
-
-
-
Constructor Detail
-
CSVCurveParser
public CSVCurveParser()
Set up the parser with default interpolation.InterpolationMethod.LINEAR
ExtrapolationMethod.CONSTANT
InterpolationEntity.LOG_OF_VALUE_PER_TIME
-
CSVCurveParser
public CSVCurveParser(CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
Set up the parser with given interpolation.- Parameters:
interpolationMethod
- The interpolation method.extrapolationMethod
- The extrapolation method.interpolationEntity
- The interpolation entity.
-
-
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.
-
setInterpolation
public void setInterpolation(CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
Set interpolation method for parsed curves.- Parameters:
interpolationMethod
- The interpolation method.extrapolationMethod
- The extrapolation method.interpolationEntity
- The interpolation entity.
-
-