java.lang.Object
net.finmath.parser.CSVCurveParser
Provides options to parse curves.
- Author:
- Roland Bachl
-
Constructor Summary
ConstructorsConstructorDescriptionSet 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
Modifier and TypeMethodDescriptionstatic LocalDate[]
getReferenceDates(Curve[] curves)
Extract the reference date of each curve in an array.Extract a single discount curve from a csv file.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 Details
-
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 Details
-
parseCSV
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
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.
-
getReferenceDates
Extract the reference date of each curve in an array.- Parameters:
curves
- The array of curves.- Returns:
- Array of the respective reference dates.
-