E
- a representation of a date, typically JDK: Date, Calendar;
Joda:LocalDate, YearMonthDaypublic abstract class AbstractKitCalculatorsFactory<E extends Serializable> extends Object implements KitCalculatorsFactory<E>
Constructor and Description |
---|
AbstractKitCalculatorsFactory() |
Modifier and Type | Method and Description |
---|---|
protected CurrencyDateCalculatorBuilder<E> |
configureCurrencyCalculatorBuilder(CurrencyDateCalculatorBuilder<E> builder)
Method that may be called by the specialised factory methods and will fetch the registered holidayCalendar for all 3 currencies
and the working weeks via the currencyCalculatorConfig and assigning currencyCalculatorConfig to the builder,
using the DefaultCurrencyCalculatorConfig if not modified.
|
CurrencyCalculatorConfig |
getCurrencyCalculatorConfig()
Provides the registered instance of currencyCalculatorConfig or use DefaultCurrencyCalculatorConfig if none registered.
|
HolidayCalendar<E> |
getHolidayCalendar(String name)
Provides an immutable Holiday Calendar with that name if registered, null if not registered
|
Set<String> |
getRegisteredHolidayCalendarNames()
Provides the immutable set of registered calendar names
|
boolean |
isHolidayCalendarRegistered(String name)
Check if a calendar of a given name is already registered.
|
KitCalculatorsFactory<E> |
registerHolidays(String name,
HolidayCalendar<E> holidaysCalendar)
Use this method to register a given calendar, it will replace any
existing one with the same name.
|
void |
setCurrencyCalculatorConfig(CurrencyCalculatorConfig config)
Use this method register a specific currency config, if not provided then the DefaultCurrencyCalculatorConfig will be given.
|
protected void |
setHolidays(String name,
DateCalculator<E> dc)
Used by extensions to set holidays in a DateCalculator.
|
KitCalculatorsFactory<E> |
unregisterAllHolidayCalendars()
unregister all holiday calendars;
|
KitCalculatorsFactory<E> |
unregisterHolidayCalendar(String calendarName)
Unregister a given holiday calendar
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildCurrencyDateCalculator, getDateCalculator, getDefaultCurrencyDateCalculator, getDefaultCurrencyDateCalculatorBuilder, getHolidayHandler, getIMMDateCalculator, getPeriodCountCalculator
public void setCurrencyCalculatorConfig(CurrencyCalculatorConfig config)
setCurrencyCalculatorConfig
in interface KitCalculatorsFactory<E extends Serializable>
config
- that specifies the set of currencies subject to USD T+1 and the WorkingWeeks per currency.public CurrencyCalculatorConfig getCurrencyCalculatorConfig()
getCurrencyCalculatorConfig
in interface KitCalculatorsFactory<E extends Serializable>
DefaultCurrencyCalculatorConfig
public KitCalculatorsFactory<E> registerHolidays(String name, HolidayCalendar<E> holidaysCalendar)
registerHolidays
in interface KitCalculatorsFactory<E extends Serializable>
name
- the calendar name to register these holidays under.holidaysCalendar
- a calendar containing a set of holidays (non-working days).public boolean isHolidayCalendarRegistered(String name)
isHolidayCalendarRegistered
in interface KitCalculatorsFactory<E extends Serializable>
public HolidayCalendar<E> getHolidayCalendar(String name)
getHolidayCalendar
in interface KitCalculatorsFactory<E extends Serializable>
protected void setHolidays(String name, DateCalculator<E> dc)
name
- holiday namedc
- the date calculator to configure.public Set<String> getRegisteredHolidayCalendarNames()
getRegisteredHolidayCalendarNames
in interface KitCalculatorsFactory<E extends Serializable>
public KitCalculatorsFactory<E> unregisterHolidayCalendar(String calendarName)
unregisterHolidayCalendar
in interface KitCalculatorsFactory<E extends Serializable>
calendarName
- the calendar name to unregister.public KitCalculatorsFactory<E> unregisterAllHolidayCalendars()
unregisterAllHolidayCalendars
in interface KitCalculatorsFactory<E extends Serializable>
protected CurrencyDateCalculatorBuilder<E> configureCurrencyCalculatorBuilder(CurrencyDateCalculatorBuilder<E> builder)
builder
- the original builderCopyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.