net.objectlab.kit.datecalc.common
Interface KitCalculatorsFactory<E>

Package class diagram package KitCalculatorsFactory
Type Parameters:
E - a representation of a date, typically JDK: Date, Calendar; Joda:LocalDate, YearMonthDay
All Known Implementing Classes:
AbstractKitCalculatorsFactory

public interface KitCalculatorsFactory<E>

Factory will create new instances of calculators, these are lightweight, each thread should use the factory as a given calculator should NOT be shared across thread (unless you know what you're doing) as the startDate, current date and working week would be shared. Once created, the set of holidays will NOT change even if a new set is registered; one needs to get a new DateCalculator to get the new set.

Version:
$Revision: 267 $ $Date: 2009-02-09 10:55:20 -0500 (Mon, 09 Feb 2009) $
Author:
Benoit Xhenseval, $LastChangedBy: benoitx $

Method Summary
 DateCalculator<E> getDateCalculator(String name, String holidayHandlerType)
          Create a new DateCalculator for a given name and type of handling.
 HolidayCalendar<E> getHolidayCalendar(String calendarName)
           
 IMMDateCalculator<E> getIMMDateCalculator()
          Create a new IMMDateCalculator.
 PeriodCountCalculator<E> getPeriodCountCalculator()
          Create a new PeriodCountCalculator.
 Set<String> getRegisteredHolidayCalendarNames()
           
 boolean isHolidayCalendarRegistered(String calendarName)
           
 void registerHolidays(String calendarName, HolidayCalendar<E> holidaysCalendar)
          Use this method to register a holidays calendar.
 void unregisterAllHolidayCalendars()
          unregister all holiday calendars;
 void unregisterHolidayCalendar(String calendarName)
          Unregister a given holiday calendar
 

Method Detail

getDateCalculator

DateCalculator<E> getDateCalculator(String name,
                                    String holidayHandlerType)
Create a new DateCalculator for a given name and type of handling.

Parameters:
name - calendar name (holidays set interested in). If there is set of holidays with that name, it will return a DateCalculator with an empty holiday set (will work on Weekend only).
holidayHandlerType - typically one of the value of HolidayHandlerType or null.
Returns:
a new DateCalculator
Throws:
IllegalArgumentException - if the type is not null or a valid value.

registerHolidays

void registerHolidays(String calendarName,
                      HolidayCalendar<E> holidaysCalendar)
Use this method to register a holidays calendar.

Parameters:
calendarName - the calendar name to register these holidays under.
holidaysCalendar - the holiday calendar (non-working days with boundaries).

isHolidayCalendarRegistered

boolean isHolidayCalendarRegistered(String calendarName)
Returns:
true if the holiday calendar name is registered.

getHolidayCalendar

HolidayCalendar<E> getHolidayCalendar(String calendarName)
Returns:
an immutable Holiday Calendar name that is registered.

getRegisteredHolidayCalendarNames

Set<String> getRegisteredHolidayCalendarNames()
Returns:
an immutable set of registered calendar names

unregisterHolidayCalendar

void unregisterHolidayCalendar(String calendarName)
Unregister a given holiday calendar

Parameters:
calendarName - the calendar name to unregister.

unregisterAllHolidayCalendars

void unregisterAllHolidayCalendars()
unregister all holiday calendars;


getPeriodCountCalculator

PeriodCountCalculator<E> getPeriodCountCalculator()
Create a new PeriodCountCalculator.

Returns:
a PeriodCountCalculator

getIMMDateCalculator

IMMDateCalculator<E> getIMMDateCalculator()
Create a new IMMDateCalculator.

Returns:
an IMMDateCalculator


Copyright © 2006-2010 Appendium - Portfolio Financing Platform. All Rights Reserved.