net.finmath.time
Class Tenor
- java.lang.Object
-
- net.finmath.time.TimeDiscretization
-
- net.finmath.time.Tenor
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<java.lang.Double>, TenorInterface, TimeDiscretizationInterface
public class Tenor extends TimeDiscretization implements TenorInterface
Implements a time discretization based on dates using a reference date and an daycount convention / year fraction. The time as a double is represented as the year fraction from the reference date.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.finmath.time.TimeDiscretization
TimeDiscretization.ShortPeriodLocation
-
-
Constructor Summary
Constructors Constructor and Description Tenor(java.util.Calendar[] dates, java.util.Calendar referenceDate)Tenor(double[] timeDiscretization)Construct a tenor from a time discretization.Tenor(java.lang.Double[] timeDiscretization)Construct a tenor from a time discretization.Tenor(double initial, double last, double deltaT, TimeDiscretization.ShortPeriodLocation shortPeriodLocation)Construct a tenor from meta data.Tenor(double initial, int numberOfTimeSteps, double deltaT)Construct a tenor from meta data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.CalendargetDate(int timeIndex)Returns the date for the given time index.doublegetDaycountFraction(int timeIndex)Returns the day count fraction for the period form timeIndex to to timeIndex+1.java.util.CalendargetReferenceDate()-
Methods inherited from class net.finmath.time.TimeDiscretization
equals, getAsArrayList, getAsDoubleArray, getNumberOfTimes, getNumberOfTimeSteps, getTime, getTimeIndex, getTimeIndexNearestGreaterOrEqual, getTimeIndexNearestLessOrEqual, getTimeShiftedTimeDiscretization, getTimeStep, hashCode, iterator, toString
-
-
-
-
Constructor Detail
-
Tenor
public Tenor(java.util.Calendar[] dates, java.util.Calendar referenceDate)- Parameters:
dates- A set of dates.referenceDate- The reference date, which defines t=0 with respect to the internal double representation.
-
Tenor
public Tenor(double[] timeDiscretization)
Construct a tenor from a time discretization.- Parameters:
timeDiscretization- A time discretization.
-
Tenor
public Tenor(java.lang.Double[] timeDiscretization)
Construct a tenor from a time discretization.- Parameters:
timeDiscretization- A time discretization.
-
Tenor
public Tenor(double initial, int numberOfTimeSteps, double deltaT)Construct a tenor from meta data.- Parameters:
initial- First discretization point.numberOfTimeSteps- Number of time steps.deltaT- Time step size.
-
Tenor
public Tenor(double initial, double last, double deltaT, TimeDiscretization.ShortPeriodLocation shortPeriodLocation)Construct a tenor from meta data.- Parameters:
initial- First discretization point.last- Last time steps.deltaT- Time step size.shortPeriodLocation- Placement of the stub period.
-
-
Method Detail
-
getReferenceDate
public java.util.Calendar getReferenceDate()
- Specified by:
getReferenceDatein interfaceTenorInterface- Returns:
- The reference date of this tenor, i.e., the date mapped to 0.0
-
getDate
public java.util.Calendar getDate(int timeIndex)
Description copied from interface:TenorInterfaceReturns the date for the given time index.- Specified by:
getDatein interfaceTenorInterface- Parameters:
timeIndex- Time index- Returns:
- Returns the date for a given time index.
-
getDaycountFraction
public double getDaycountFraction(int timeIndex)
Description copied from interface:TenorInterfaceReturns the day count fraction for the period form timeIndex to to timeIndex+1.- Specified by:
getDaycountFractionin interfaceTenorInterface- Parameters:
timeIndex- Time index- Returns:
- Returns the day count fraction.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG