- java.lang.Object
-
- net.finmath.singleswaprate.data.DataTableBasic
-
- net.finmath.singleswaprate.data.DataTableLinear
-
- All Implemented Interfaces:
Serializable
,Cloneable
,DataTable
public class DataTableLinear extends DataTableBasic implements DataTable, Cloneable
ExtendsDataTableBasic
with the capacity to interpolate values between tenor grid nodes, usingBiLinearInterpolation
Note that the interpolation is done to the accuracy of the table convention.- Author:
- Christian Fries, Roland Bachl
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.finmath.singleswaprate.data.DataTableBasic
DataTableBasic.DoubleKey
-
Nested classes/interfaces inherited from interface net.finmath.singleswaprate.data.DataTable
DataTable.TableConvention
-
-
Constructor Summary
Constructors Constructor Description DataTableLinear(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData)
Create an empty table.DataTableLinear(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData, int[] maturities, int[] terminations, double[] values)
Create a table.DataTableLinear(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData, List<Integer> maturities, List<Integer> terminations, List<Double> values)
Create a table.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DataTableLinear
clone()
double
getValue(double maturity, double termination)
Returns the value of the table at a given time.double
getValue(int maturity, int termination)
Returns the value of the table at a given time.static DataTableLinear
interpolateDataTable(DataTableBasic baseTable)
Create an interpolated table from a basic table.String
toString()
String
toString(double unit)
-
Methods inherited from class net.finmath.singleswaprate.data.DataTableBasic
addPoint, addPoints, containsEntryFor, containsEntryFor, getConvention, getMaturities, getMaturitiesForTermination, getName, getReferenceDate, getScheduleMetaData, getTerminations, getTerminationsForMaturity, getValue, size, upgradeDataTableLight
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.finmath.singleswaprate.data.DataTable
addPoint, addPoints, containsEntryFor, containsEntryFor, getConvention, getMaturities, getMaturitiesForTermination, getName, getReferenceDate, getScheduleMetaData, getTerminations, getTerminationsForMaturity, size
-
-
-
-
Constructor Detail
-
DataTableLinear
public DataTableLinear(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.
-
DataTableLinear
public DataTableLinear(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.
-
DataTableLinear
public DataTableLinear(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 Detail
-
interpolateDataTable
public static DataTableLinear interpolateDataTable(DataTableBasic baseTable)
Create an interpolated table from a basic table.- Parameters:
baseTable
- The table to receive interpolation.- Returns:
- The table with interpolation.
-
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 interfaceDataTable
- Overrides:
getValue
in classDataTableBasic
- 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 interfaceDataTable
- Overrides:
getValue
in classDataTableBasic
- 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 DataTableLinear clone()
- Specified by:
clone
in interfaceDataTable
- Overrides:
clone
in classDataTableBasic
- Returns:
- A copy of the table.
-
toString
public String toString()
- Overrides:
toString
in classDataTableBasic
-
toString
public String toString(double unit)
- Overrides:
toString
in classDataTableBasic
-
-