org.jfin.date.accrual.impl
Class FloatAccrualPeriod
- java.lang.Object
-
- org.jfin.date.Period
-
- org.jfin.date.accrual.AccrualPeriod
-
- org.jfin.date.accrual.impl.FloatAccrualPeriod
-
- All Implemented Interfaces:
- java.lang.Comparable, Initialisable
public class FloatAccrualPeriod extends AccrualPeriod
Concrete implementation of AccrualPeriod that models a floating rate period which requires fixing (e.g. the float leg of a Swap).
-
-
Constructor Summary
Constructors Constructor and Description FloatAccrualPeriod()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description FloatAccrualPeriodclone()java.util.CalendargetAdjustedFixingCalendar()Gets the adjusted fixing dateFixingAdjustmentTypegetFixingAdjustmentType()Gets the fixing adjustment typeBusinessDayConventiongetFixingBusinessDayConvention()Gets the business day convention used for adjusting the fixing datejava.util.CalendargetFixingCalendar()Gets the unadjusted fixing dateintgetFixingCalendarOffsetAmount()Gets the offset from the payment date (in business days) for the fixing date, typically this will be 0 (for GBP LIBOR) or -2 (for other indexes)HolidayCalendargetFixingHolidayCalendar()Gets the holiday calendar used for adjusting the fixing datedoublegetFixingRate()Gets the fixing rate which has been applied to to this period or Double.NaN if the rate is not set.doublegetPaymentAmount(double notional)Returns the payment amount for this period based upon the provided notionalvoidinitialise()Initialises this period setting (if possible) the fixing date based upon the start date, fixing holiday calendar and fixing offset amount.booleanisPaymentPossible()voidsetFixingAdjustmentType(FixingAdjustmentType fixingAdjustmentType)Sets the fixing adjustment typevoidsetFixingBusinessDayConvention(BusinessDayConvention fixingBusinessDayConvention)Sets the business day convention used for adjusting the fixing datevoidsetFixingCalendar(java.util.Calendar fixingCalendar)Sets the unadjusted fixing datevoidsetFixingCalendarOffsetAmount(int fixingCalendarOffsetAmount)Sets the offset from the payment date (in business days) for the fixing date, typically this will be 0 (for GBP LIBOR) or -2 (for other indexes)voidsetFixingHolidayCalendar(HolidayCalendar fixingHolidayCalendar)Sets the holiday calendar used for adjusting the fixing datevoidsetFixingRate(double fixingRate)Sets the fixing rate which has been applied to to this period or Double.NaN if the rate is not set-
Methods inherited from class org.jfin.date.accrual.AccrualPeriod
getAccrualBusinessDayConvention, getAccrualHolidayCalendar, getAdjustedDaycountFraction, getAdjustedEndCalendar, getAdjustedPaymentCalendar, getAdjustedStartCalendar, getDaycountCalculator, getPaymentBusinessDayConvention, getPaymentCalendar, getPaymentHolidayCalendar, getPaymentType, setAccrualBusinessDayConvention, setAccrualHolidayCalendar, setDaycountCalculator, setPaymentBusinessDayConvention, setPaymentCalendar, setPaymentHolidayCalendar, setPaymentType
-
Methods inherited from class org.jfin.date.Period
compareTo, getEndCalendar, getReferenceEndCalendar, getReferenceStartCalendar, getStartCalendar, setEndCalendar, setReferenceEndCalendar, setReferenceStartCalendar, setStartCalendar, toString
-
-
-
-
Method Detail
-
clone
public FloatAccrualPeriod clone()
-
initialise
public void initialise()
Initialises this period setting (if possible) the fixing date based upon the start date, fixing holiday calendar and fixing offset amount.- Specified by:
initialisein interfaceInitialisable- Overrides:
initialisein classAccrualPeriod
-
getPaymentAmount
public double getPaymentAmount(double notional) throws java.lang.ExceptionReturns the payment amount for this period based upon the provided notional- Specified by:
getPaymentAmountin classAccrualPeriod- Parameters:
notional- The notional amount- Returns:
- The payment amount
- Throws:
java.lang.Exception- Throws an exception if the daycount fraction cannot be calculated or if the fixingRate has not been set (isNaN)
-
isPaymentPossible
public boolean isPaymentPossible()
- Specified by:
isPaymentPossiblein classAccrualPeriod
-
getAdjustedFixingCalendar
public java.util.Calendar getAdjustedFixingCalendar() throws AccrualExceptionGets the adjusted fixing date- Returns:
- The adjusted fixing date as a calendar
- Throws:
AccrualException- If there is a problem creating the adjusted fixing calendar
-
getFixingCalendar
public java.util.Calendar getFixingCalendar()
Gets the unadjusted fixing date- Returns:
- The fixing date as a calendar
-
setFixingCalendar
public void setFixingCalendar(java.util.Calendar fixingCalendar)
Sets the unadjusted fixing date- Parameters:
fixingCalendar- The fixing date as a calendar
-
getFixingAdjustmentType
public FixingAdjustmentType getFixingAdjustmentType()
Gets the fixing adjustment type- Returns:
- The fixing adjustment type
-
setFixingAdjustmentType
public void setFixingAdjustmentType(FixingAdjustmentType fixingAdjustmentType)
Sets the fixing adjustment type- Parameters:
fixingAdjustmentType- The fixing adjustment type
-
getFixingBusinessDayConvention
public BusinessDayConvention getFixingBusinessDayConvention()
Gets the business day convention used for adjusting the fixing date- Returns:
- The fixing business day convention
-
setFixingBusinessDayConvention
public void setFixingBusinessDayConvention(BusinessDayConvention fixingBusinessDayConvention)
Sets the business day convention used for adjusting the fixing date- Parameters:
fixingBusinessDayConvention- The fixing business day convention
-
getFixingHolidayCalendar
public HolidayCalendar getFixingHolidayCalendar()
Gets the holiday calendar used for adjusting the fixing date- Returns:
- The fixing holiday calendar
-
setFixingHolidayCalendar
public void setFixingHolidayCalendar(HolidayCalendar fixingHolidayCalendar)
Sets the holiday calendar used for adjusting the fixing date- Parameters:
fixingHolidayCalendar- The fixing holiday calendar
-
getFixingCalendarOffsetAmount
public int getFixingCalendarOffsetAmount()
Gets the offset from the payment date (in business days) for the fixing date, typically this will be 0 (for GBP LIBOR) or -2 (for other indexes)- Returns:
- The fixing offset amount
-
setFixingCalendarOffsetAmount
public void setFixingCalendarOffsetAmount(int fixingCalendarOffsetAmount)
Sets the offset from the payment date (in business days) for the fixing date, typically this will be 0 (for GBP LIBOR) or -2 (for other indexes)- Parameters:
fixingCalendarOffsetAmount- The fixing offset amount
-
getFixingRate
public double getFixingRate()
Gets the fixing rate which has been applied to to this period or Double.NaN if the rate is not set.- Returns:
- The fixing rate
-
setFixingRate
public void setFixingRate(double fixingRate)
Sets the fixing rate which has been applied to to this period or Double.NaN if the rate is not set- Parameters:
fixingRate- The fixing rate
-
-
DataMelt 3.0 © DataMelt by jWork.ORG