Class DataTableExtrapolated

All Implemented Interfaces:
Serializable, Cloneable, DataTable

public class DataTableExtrapolated extends DataTableInterpolated implements DataTable, Cloneable
Extends DataTableBasic with the capacity to inter- and extrapolate values off the tenor grid. Note that the interpolation is done to the accuracy of the table convention.
Author:
Christian Fries, Roland Bachl
See Also:
  • Constructor Details

    • DataTableExtrapolated

      public DataTableExtrapolated(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData)
      Create an empty table.
      Parameters:
      name - The name of the table.
      convention - The convention of the table.
      referenceDate - The referenceDate of the table.
      scheduleMetaData - The schedule meta data of the table.
    • DataTableExtrapolated

      public DataTableExtrapolated(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData, int[] maturities, int[] terminations, double[] values)
      Create a table.
      Parameters:
      name - The name of the table.
      convention - The convention of the table.
      referenceDate - The referenceDate of the table.
      scheduleMetaData - The schedule meta data of the table.
      maturities - The maturities of the points as offset with respect to the reference date.
      terminations - The terminations of the points as offset with respect to the maturity date.
      values - The values at the points.
    • DataTableExtrapolated

      public DataTableExtrapolated(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData, List<Integer> maturities, List<Integer> terminations, List<Double> values)
      Create a table.
      Parameters:
      name - The name of the table.
      convention - The convention of the table.
      referenceDate - The referenceDate of the table.
      scheduleMetaData - The schedule meta data of the table.
      maturities - The maturities of the points as offset with respect to the reference date.
      terminations - The terminations of the points as offset with respect to the maturity date.
      values - The values at the points.
  • Method Details

    • getValue

      public double getValue(int maturity, int termination)
      Description copied from interface: DataTable
      Returns the value of the table at a given time. Interpolates if the table is set up to do so.
      Specified by:
      getValue in interface DataTable
      Overrides:
      getValue in class DataTableInterpolated
      Parameters:
      maturity - The maturity as offset with respect to the reference date.
      termination - The termination as offset with respect to the maturity date.
      Returns:
      Value at the given time.
    • getValue

      public double getValue(double maturity, double termination)
      Description copied from interface: DataTable
      Returns the value of the table at a given time. Interpolates if the table is set up to do so.
      Specified by:
      getValue in interface DataTable
      Overrides:
      getValue in class DataTableInterpolated
      Parameters:
      maturity - Maturity in double as year fraction with respect to reference date.
      termination - Termination in double as year fraction with respect to reference date.
      Returns:
      Value at the given time.
    • clone

      public DataTableExtrapolated clone()
      Specified by:
      clone in interface DataTable
      Overrides:
      clone in class DataTableInterpolated
      Returns:
      A copy of the table.
    • toString

      public String toString()
      Overrides:
      toString in class DataTableInterpolated
    • toString

      public String toString(double unit)
      Overrides:
      toString in class DataTableInterpolated