public class DataTableBasic extends Object implements DataTable, Cloneable
DataTable, which provides no means of inter- or extrapolation.| Modifier and Type | Class and Description |
|---|---|
protected class |
DataTableBasic.DoubleKey
Nested class to use as key in values map.
|
DataTable.TableConvention| Constructor and Description |
|---|
DataTableBasic(String name,
DataTable.TableConvention convention,
LocalDate referenceDate,
SchedulePrototype scheduleMetaData)
Create an empty table.
|
DataTableBasic(String name,
DataTable.TableConvention convention,
LocalDate referenceDate,
SchedulePrototype scheduleMetaData,
int[] maturities,
int[] terminations,
double[] values)
Create a table.
|
DataTableBasic(String name,
DataTable.TableConvention convention,
LocalDate referenceDate,
SchedulePrototype scheduleMetaData,
List<Integer> maturities,
List<Integer> terminations,
List<Double> values)
Create a table.
|
| Modifier and Type | Method and Description |
|---|---|
DataTable |
addPoint(int maturity,
int termination,
double value)
Add a point to the grid of the table.
|
DataTable |
addPoints(int[] maturities,
int[] terminations,
double[] values)
Add an array of points to the table.
|
DataTableBasic |
clone() |
boolean |
containsEntryFor(double maturity,
double termination)
Checks whether the table has an actual entry at the specified coordinates.
|
boolean |
containsEntryFor(int maturity,
int termination)
Checks whether the table has an actual entry at the specified coordinates.
|
DataTable.TableConvention |
getConvention()
Returns the convention the table understands its coordinates in.
|
TreeSet<Integer> |
getMaturities()
Get a sorted set view of all maturities in the table.
|
TreeSet<Integer> |
getMaturitiesForTermination(int termination)
Get a sorted set view of all maturities for a speceific termination in the table.
|
String |
getName() |
LocalDate |
getReferenceDate()
The reference date of the table.
|
SchedulePrototype |
getScheduleMetaData() |
TreeSet<Integer> |
getTerminations()
Get a sorted set view of all terminations in the table.
|
TreeSet<Integer> |
getTerminationsForMaturity(int maturity)
Get a sorted set view of all terminations for a specific maturity in the table.
|
protected double |
getValue(DataTableBasic.DoubleKey key) |
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.
|
int |
size() |
String |
toString() |
String |
toString(double unit) |
static DataTableBasic |
upgradeDataTableLight(DataTableLight baseTable,
LocalDate referenceDate,
SchedulePrototype scheduleMetaData)
Create a DataTableBasic by upgrading a
DataTableLight to allow access via double representation. |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexportTablepublic DataTableBasic(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData)
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.public DataTableBasic(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData, int[] maturities, int[] terminations, double[] values)
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.public DataTableBasic(String name, DataTable.TableConvention convention, LocalDate referenceDate, SchedulePrototype scheduleMetaData, List<Integer> maturities, List<Integer> terminations, List<Double> values)
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.public static DataTableBasic upgradeDataTableLight(DataTableLight baseTable, LocalDate referenceDate, SchedulePrototype scheduleMetaData)
DataTableLight to allow access via double representation.baseTable - The table to be upgraded.referenceDate - The reference date.scheduleMetaData - The schedule meta data of the table.public DataTable addPoint(int maturity, int termination, double value)
DataTableaddPoint in interface DataTablematurity - The maturity of the point as offset with respect to the reference date.termination - The termination of the point as offset with respect to the maturity date.value - The value at the point.public DataTable addPoints(int[] maturities, int[] terminations, double[] values)
DataTableaddPoints in interface DataTablematurities - 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.public double getValue(int maturity,
int termination)
DataTablepublic double getValue(double maturity,
double termination)
DataTablepublic int size()
public boolean containsEntryFor(int maturity,
int termination)
DataTablegetValue on these coordinates as the table may interpolate/extrapolate.containsEntryFor in interface DataTablematurity - The maturity as offset with respect to the reference date.termination - The termination as offset with respect to the maturity date.public boolean containsEntryFor(double maturity,
double termination)
DataTablegetValue on these coordinates as the table may interpolate/extrapolate.containsEntryFor in interface DataTablematurity - Maturity in double as year fraction with respect to reference date.termination - Termination in double as year fraction with respect to reference date.public TreeSet<Integer> getMaturities()
DataTablegetMaturities in interface DataTablepublic TreeSet<Integer> getTerminations()
DataTablegetTerminations in interface DataTablepublic TreeSet<Integer> getTerminationsForMaturity(int maturity)
DataTablegetTerminationsForMaturity in interface DataTablematurity - The maturity for which to get the terminations.public TreeSet<Integer> getMaturitiesForTermination(int termination)
DataTablegetMaturitiesForTermination in interface DataTabletermination - The termination for which to get the maturities.public String getName()
public LocalDate getReferenceDate()
DataTablegetReferenceDate in interface DataTablepublic DataTable.TableConvention getConvention()
DataTablegetConvention in interface DataTablepublic SchedulePrototype getScheduleMetaData()
getScheduleMetaData in interface DataTableSchedulePrototype used by the table to convert int and double representations.public DataTableBasic clone()
public String toString(double unit)
protected double getValue(DataTableBasic.DoubleKey key)
Copyright © 2019. All rights reserved.