public class CSVCurveParser extends Object
Constructor and 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.
|
Modifier and Type | Method and 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.
|
public CSVCurveParser()
InterpolationMethod.LINEAR
ExtrapolationMethod.CONSTANT
InterpolationEntity.LOG_OF_VALUE_PER_TIME
public CSVCurveParser(CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
interpolationMethod
- The interpolation method.extrapolationMethod
- The extrapolation method.interpolationEntity
- The interpolation entity.public DiscountCurve parseCSV(File file, String currency, String index) throws IOException
file
- The file to be parsed.currency
- The currency of the curve.index
- The index of the curve.IOException
- Thrown upon an exception related to File.public DiscountCurve[] parseZIP(File file, String currency, String index) throws IOException
file
- The archive to be parsed.currency
- The currency of the curves.index
- The index of the curves.IOException
- Thrown upon an exception related to File.public void setInterpolation(CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
interpolationMethod
- The interpolation method.extrapolationMethod
- The extrapolation method.interpolationEntity
- The interpolation entity.Copyright © 2020. All rights reserved.