Class PiecewiseCurve

    • Constructor Detail

      • PiecewiseCurve

        public PiecewiseCurve​(Curve curve,
                              Curve fixedPartCurve,
                              double fixedPartStartTime,
                              double fixedPartEndTime)
    • Method Detail

      • getParameter

        public double[] getParameter()
        Description copied from interface: ParameterObject
        Get the current parameter associated with the state of the objects.
        Specified by:
        getParameter in interface ParameterObject
        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 interface ParameterObject
        Parameters:
        parameter - The parameter associated with the new state of the objects.
      • getName

        public String getName()
        Description copied from interface: Curve
        Get the name of the curve.
        Specified by:
        getName in interface Curve
        Overrides:
        getName in class AbstractCurve
        Returns:
        The name of this curve
      • getReferenceDate

        public LocalDate 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 interface Curve
        Overrides:
        getReferenceDate in class AbstractCurve
        Returns:
        The date identified as t=0.
      • getBaseCurve

        public Curve getBaseCurve()
        Returns:
        the baseCurve
      • getFixedPartCurve

        public Curve 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 interface Curve
        Overrides:
        getValue in class AbstractCurve
        Parameters:
        time - Time for which the value should be returned.
        Returns:
        The value at the give time.
      • getValue

        public double getValue​(AnalyticModel model,
                               double time)
        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.
        Specified by:
        getValue in interface Curve
        Parameters:
        model - An analytic model providing a context.
        time - Time for which the value should be returned.
        Returns:
        The value at the give time.
      • getCloneBuilder

        public PiecewiseCurve.Builder getCloneBuilder()
                                               throws CloneNotSupportedException
        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 interface Curve
        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.