Module net.finmath.lib
Class CurveInterpolation.Builder
- java.lang.Object
-
- net.finmath.marketdata2.model.curves.CurveInterpolation.Builder
-
- All Implemented Interfaces:
CurveBuilder
- Enclosing class:
- CurveInterpolation
public static class CurveInterpolation.Builder extends Object implements CurveBuilder
A builder (following the builder pattern) for CurveFromInterpolationPoints objects. Allows to successively construct a curveFromInterpolationPoints object by adding points.- Author:
- Christian Fries
-
-
Constructor Summary
Constructors Constructor Description Builder()Build a curveFromInterpolationPoints.Builder(String name, LocalDate referenceDate)Build a curveFromInterpolationPoints with a given name and given reference date.Builder(CurveInterpolation curveInterpolation)Build a curveFromInterpolationPoints by cloning a given curveFromInterpolationPoints.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CurveBuilderaddPoint(double time, RandomVariable value, boolean isParameter)Add a point to the curve.Curvebuild()Build the curve.CurveBuildersetExtrapolationMethod(CurveInterpolation.ExtrapolationMethod extrapolationMethod)Set the extrapolation method of the curveFromInterpolationPoints.CurveBuildersetInterpolationEntity(CurveInterpolation.InterpolationEntity interpolationEntity)Set the interpolationEntity of the curveFromInterpolationPoints.CurveBuildersetInterpolationMethod(CurveInterpolation.InterpolationMethod interpolationMethod)Set the interpolation method of the curveFromInterpolationPoints.
-
-
-
Constructor Detail
-
Builder
public Builder()
Build a curveFromInterpolationPoints.
-
Builder
public Builder(String name, LocalDate referenceDate)
Build a curveFromInterpolationPoints with a given name and given reference date.- Parameters:
name- The name of this curveFromInterpolationPoints.referenceDate- The reference date for this curveFromInterpolationPoints, i.e., the date which defined t=0.
-
Builder
public Builder(CurveInterpolation curveInterpolation) throws CloneNotSupportedException
Build a curveFromInterpolationPoints by cloning a given curveFromInterpolationPoints.- Parameters:
curveInterpolation- A curveFromInterpolationPoints to be used as starting point for the new curveFromInterpolationPoints.- Throws:
CloneNotSupportedException- Thrown, when the curveFromInterpolationPoints could not be cloned.
-
-
Method Detail
-
build
public Curve build()
Description copied from interface:CurveBuilderBuild the curve. The method returns the curve object. The builder cannot be used to build another curve. Use clone instead.- Specified by:
buildin interfaceCurveBuilder- Returns:
- The curve according to the specification.
-
setInterpolationMethod
public CurveBuilder setInterpolationMethod(CurveInterpolation.InterpolationMethod interpolationMethod)
Set the interpolation method of the curveFromInterpolationPoints.- Parameters:
interpolationMethod- The interpolation method of the curveFromInterpolationPoints.- Returns:
- A self reference to this curveFromInterpolationPoints build object.
-
setExtrapolationMethod
public CurveBuilder setExtrapolationMethod(CurveInterpolation.ExtrapolationMethod extrapolationMethod)
Set the extrapolation method of the curveFromInterpolationPoints.- Parameters:
extrapolationMethod- The extrapolation method of the curveFromInterpolationPoints.- Returns:
- A self reference to this curveFromInterpolationPoints build object.
-
setInterpolationEntity
public CurveBuilder setInterpolationEntity(CurveInterpolation.InterpolationEntity interpolationEntity)
Set the interpolationEntity of the curveFromInterpolationPoints.- Parameters:
interpolationEntity- The interpolation entity of the curveFromInterpolationPoints.- Returns:
- A self reference to this curveFromInterpolationPoints build object.
-
addPoint
public CurveBuilder addPoint(double time, RandomVariable value, boolean isParameter)
Description copied from interface:CurveBuilderAdd a point to the curve.- Specified by:
addPointin 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(RandomVariable[])- Returns:
- A self reference to this curve build object.
-
-