java.lang.Object
net.finmath.marketdata.model.curves.CurveInterpolation.Builder
- All Implemented Interfaces:
CurveBuilder
- Direct Known Subclasses:
PiecewiseCurve.Builder
,SeasonalCurve.Builder
- Enclosing class:
- CurveInterpolation
A builder (following the builder pattern) for CurveFromInterpolationPoints objects.
Allows to successively construct a curve object by adding points.
- Author:
- Christian Fries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPoint(double time, double value, boolean isParameter)
Add a point to the curve.build()
Build the curve.setExtrapolationMethod(CurveInterpolation.ExtrapolationMethod extrapolationMethod)
Set the extrapolation method of the curve.setInterpolationEntity(CurveInterpolation.InterpolationEntity interpolationEntity)
Set the interpolationEntity of the curve.setInterpolationMethod(CurveInterpolation.InterpolationMethod interpolationMethod)
Set the interpolation method of the curve.
-
Constructor Details
-
Builder
public Builder()Build a curve. -
Builder
Build a curve with a given name and given reference date.- Parameters:
name
- The name of this curve.referenceDate
- The reference date for this curve, i.e., the date which defined t=0.
-
Builder
Build a curve by cloning a given curve.- Parameters:
curveInterpolation
- A curve to be used as starting point for the new curve.- Throws:
CloneNotSupportedException
- Thrown, when the curve could not be cloned.
-
-
Method Details
-
build
Description copied from interface:CurveBuilder
Build the curve. The method returns the curve object. The builder cannot be used to build another curve. Use clone instead.- Specified by:
build
in interfaceCurveBuilder
- Returns:
- The curve according to the specification.
- Throws:
CloneNotSupportedException
- Thrown if the curve could not be build (likely due to a template throwingCloneNotSupportedException
.
-
addPoint
Description copied from interface:CurveBuilder
Add a point to the curve.- Specified by:
addPoint
in interfaceCurveBuilder
- Parameters:
time
- The time of the corresponding point.value
- The value of the corresponding point.isParameter
- A boolean, specifying weather the point should be considered a free parameter (true) or not (false). Fee parameters can be used to create a clone with modified values, seeCurveInterpolation.getCloneForParameter(double[])
- Returns:
- A self reference to this curve build object.
-
setInterpolationMethod
public CurveInterpolation.Builder setInterpolationMethod(CurveInterpolation.InterpolationMethod interpolationMethod)Set the interpolation method of the curve.- Parameters:
interpolationMethod
- The interpolation method of the curve.- Returns:
- A self reference to this curve build object.
-
setExtrapolationMethod
public CurveInterpolation.Builder setExtrapolationMethod(CurveInterpolation.ExtrapolationMethod extrapolationMethod)Set the extrapolation method of the curve.- Parameters:
extrapolationMethod
- The extrapolation method of the curve.- Returns:
- A self reference to this curve build object.
-
setInterpolationEntity
public CurveInterpolation.Builder setInterpolationEntity(CurveInterpolation.InterpolationEntity interpolationEntity)Set the interpolationEntity of the curve.- Parameters:
interpolationEntity
- The interpolation entity of the curve.- Returns:
- A self reference to this curve build object.
-