public abstract class AbstractCurrencyDateCalculator<E extends Serializable> extends Object implements CurrencyDateCalculator<E>, NonWorkingDayChecker<E>
Date and LocalDate are the only
viable values for it for now.
This follows convention for currency, see http://www.londonfx.co.uk/valdates.html
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCurrencyDateCalculator(CurrencyDateCalculatorBuilder<E> builder) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract E |
addMonths(E calc,
int unit) |
protected abstract E |
calculateNextDay(E date) |
E |
calculateSpotDate(E startDate)
Calculate the Spot Date taking into account the working weeks, holidays and spot lag (T+1, T+2 etc), the
calculator also takes into account special rules for Latin American Currencies or Arabic currencies.
|
E |
calculateTenorDate(E startDate,
Tenor tenor)
Calculate the Tenor Date from Spot Date taking into account the working weeks, holidays and spot lag (T+1, T+2 etc).
|
List<E> |
calculateTenorDates(E startDate,
List<Tenor> tenors)
Calculate a list of Tenor Dates from Spot Date taking into account the working weeks, holidays and spot lag (T+1, T+2 etc).
|
protected abstract int |
calendarWeekDay(E date) |
String |
getCcy1() |
ReadOnlyHolidayCalendar<E> |
getCcy1Calendar() |
WorkingWeek |
getCcy1Week() |
String |
getCcy2() |
ReadOnlyHolidayCalendar<E> |
getCcy2Calendar() |
WorkingWeek |
getCcy2Week() |
String |
getCrossCcy()
The cross currency used by this calculator.
|
ReadOnlyHolidayCalendar<E> |
getCrossCcyCalendar()
If enabled show the CrossCcy calendar that may be used on Spot or Tenor dates (in some cases, it is required that GBP/EUR AND USD [the
crossCcy] have all a working day in common for the Spot/Tenor date).
|
WorkingWeek |
getCrossCcyWeek() |
String |
getName() |
SpotLag |
getSpotLag() |
boolean |
isAdjustStartDateWithCurrencyPair() |
boolean |
isBrokenDateAllowed() |
boolean |
isNonWorkingDay(E date)
Is the given date a non working day, i.e.
|
boolean |
isUseCrossCcyOnT1ForCcy1() |
boolean |
isUseCrossCcyOnT1ForCcy2() |
protected abstract E |
max(E d1,
E d2) |
protected AbstractCurrencyDateCalculator(CurrencyDateCalculatorBuilder<E> builder)
public boolean isUseCrossCcyOnT1ForCcy1()
isUseCrossCcyOnT1ForCcy1 in interface CurrencyDateCalculator<E extends Serializable>CurrencyCalculatorConfig.getCurrenciesSubjectToCrossCcyForT1(String)public boolean isUseCrossCcyOnT1ForCcy2()
isUseCrossCcyOnT1ForCcy2 in interface CurrencyDateCalculator<E extends Serializable>CurrencyCalculatorConfig.getCurrenciesSubjectToCrossCcyForT1(String)public SpotLag getSpotLag()
getSpotLag in interface CurrencyDateCalculator<E extends Serializable>public boolean isAdjustStartDateWithCurrencyPair()
isAdjustStartDateWithCurrencyPair in interface CurrencyDateCalculator<E extends Serializable>CurrencyDateCalculatorBuilder.adjustStartDateWithCurrencyPair(boolean)public boolean isBrokenDateAllowed()
isBrokenDateAllowed in interface CurrencyDateCalculator<E extends Serializable>CurrencyDateCalculatorBuilder.brokenDateAllowed(boolean)public String getCrossCcy()
CurrencyDateCalculatorgetCrossCcy in interface CurrencyDateCalculator<E extends Serializable>public String getCcy1()
getCcy1 in interface CurrencyDateCalculator<E extends Serializable>public String getCcy2()
getCcy2 in interface CurrencyDateCalculator<E extends Serializable>public String getName()
getName in interface CurrencyDateCalculator<E extends Serializable>public ReadOnlyHolidayCalendar<E> getCcy1Calendar()
getCcy1Calendar in interface CurrencyDateCalculator<E extends Serializable>public ReadOnlyHolidayCalendar<E> getCcy2Calendar()
getCcy2Calendar in interface CurrencyDateCalculator<E extends Serializable>public ReadOnlyHolidayCalendar<E> getCrossCcyCalendar()
CurrencyDateCalculatorCurrencyDateCalculatorBuilder.brokenDateAllowed(boolean).getCrossCcyCalendar in interface CurrencyDateCalculator<E extends Serializable>public WorkingWeek getCcy1Week()
getCcy1Week in interface CurrencyDateCalculator<E extends Serializable>public WorkingWeek getCcy2Week()
getCcy2Week in interface CurrencyDateCalculator<E extends Serializable>public WorkingWeek getCrossCcyWeek()
getCrossCcyWeek in interface CurrencyDateCalculator<E extends Serializable>protected abstract int calendarWeekDay(E date)
public boolean isNonWorkingDay(E date)
NonWorkingDayCheckerisNonWorkingDay in interface NonWorkingDayChecker<E extends Serializable>public E calculateSpotDate(E startDate)
CurrencyDateCalculatorcalculateSpotDate in interface CurrencyDateCalculator<E extends Serializable>startDate - the start date which may be adjusted for the ccy pair if enabled.public E calculateTenorDate(E startDate, Tenor tenor)
CurrencyDateCalculatorcalculateTenorDate in interface CurrencyDateCalculator<E extends Serializable>startDate - the start date which may be adjusted for the ccy pair if enabled.tenor - e.g. 1Mpublic List<E> calculateTenorDates(E startDate, List<Tenor> tenors)
CurrencyDateCalculatorcalculateTenorDates in interface CurrencyDateCalculator<E extends Serializable>startDate - the start date which may be adjusted for the ccy pair if enabled.tenors - the list of tenors ('chronological order is not mandatory)Copyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.