java.lang.Object
net.finmath.marketdata.model.curves.AbstractCurve
net.finmath.marketdata.model.curves.PiecewiseCurve
- All Implemented Interfaces:
Serializable
,Cloneable
,ParameterObject
,Curve
- Direct Known Subclasses:
ForwardCurveWithFixings
A piecewise curve. The curve consists of a base curve and a second curve.
If the
time
parameter of the getValue(AnalyticModel, double)
method falls inside a pre-defined open interval, it is delegated to the second curve,
otherwise it is delegated to the base curve.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder (following the builder pattern) for PiecewiseCurve objects. -
Constructor Summary
ConstructorsConstructorDescriptionPiecewiseCurve(Curve curve, Curve fixedPartCurve, double fixedPartStartTime, double fixedPartEndTime)
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Create a deep copied clone.Returns a curve builder bases on a clone of this curve.getCloneForParameter(double[] value)
Create a clone with a modified parameter.double
double
getName()
Get the name of the curve.double[]
Get the current parameter associated with the state of the objects.Return the reference date of this curve, i.e.double
getValue(double time)
Returns the value for the time using the interpolation method associated with this curve.double
getValue(AnalyticModel model, double time)
Returns the value for the time using the interpolation method associated with this curve within a given context, i.e., a model.void
setParameter(double[] parameter)
Set the current parameter and change the state of the objects.toString()
Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve
getValues
-
Constructor Details
-
PiecewiseCurve
-
-
Method Details
-
getParameter
public double[] getParameter()Description copied from interface:ParameterObject
Get the current parameter associated with the state of the objects.- Specified by:
getParameter
in interfaceParameterObject
- Returns:
- The parameter.
-
setParameter
public void setParameter(double[] parameter)Description copied from interface:ParameterObject
Set the current parameter and change the state of the objects.- Specified by:
setParameter
in interfaceParameterObject
- Parameters:
parameter
- The parameter associated with the new state of the objects.
-
getName
Description copied from interface:Curve
Get the name of the curve.- Specified by:
getName
in interfaceCurve
- Overrides:
getName
in classAbstractCurve
- Returns:
- The name of this curve
-
getReferenceDate
Description copied from interface:Curve
Return the reference date of this curve, i.e. the date associated with t=0. May be null in case the curve is not associated with a fixed date (e.g. a time homogenous model).- Specified by:
getReferenceDate
in interfaceCurve
- Overrides:
getReferenceDate
in classAbstractCurve
- Returns:
- The date identified as t=0.
-
getBaseCurve
- Returns:
- the baseCurve
-
getFixedPartCurve
- Returns:
- the fixedPartCurve
-
getFixedPartStartTime
public double getFixedPartStartTime()- Returns:
- the fixedPartStartTime
-
getFixedPartEndTime
public double getFixedPartEndTime()- Returns:
- the fixedPartEndTime
-
getValue
public double getValue(double time)Description copied from interface:Curve
Returns the value for the time using the interpolation method associated with this curve.- Specified by:
getValue
in interfaceCurve
- Overrides:
getValue
in classAbstractCurve
- Parameters:
time
- Time for which the value should be returned.- Returns:
- The value at the give time.
-
getValue
Description copied from interface:Curve
Returns the value for the time using the interpolation method associated with this curve within a given context, i.e., a model. The model (context) is needed only if the curve relies on another curve. Examples are a forward curve which relies on a discount curve or a discount curve which is defined via a spread over another curve. -
getCloneForParameter
Description copied from interface:ParameterObject
Create a clone with a modified parameter.- Specified by:
getCloneForParameter
in interfaceCurve
- Specified by:
getCloneForParameter
in interfaceParameterObject
- Overrides:
getCloneForParameter
in classAbstractCurve
- Parameters:
value
- The new parameter.- Returns:
- A clone with an otherwise modified parameter.
- Throws:
CloneNotSupportedException
- Thrown, when the curve could not be cloned.
-
clone
Description copied from interface:Curve
Create a deep copied clone.- Specified by:
clone
in interfaceCurve
- Overrides:
clone
in classAbstractCurve
- Returns:
- A clone (deep copied).
- Throws:
CloneNotSupportedException
- Thrown, when the curve could not be cloned.
-
getCloneBuilder
Description copied from interface:Curve
Returns a curve builder bases on a clone of this curve. Using that curve builder you may create a new curve from this curve by adding points or changing properties. Note: The clone has the same name than this one.- Specified by:
getCloneBuilder
in interfaceCurve
- Returns:
- An object implementing the CurveBuilderInterface where the underlying curve is a clone of this curve.
- Throws:
CloneNotSupportedException
- Thrown, when this curve could not be cloned.
-
toString
- Overrides:
toString
in classAbstractCurve
-