net.objectlab.kit.datecalc.jdk
Class DateDateCalculator

Package class diagram package DateDateCalculator
java.lang.Object
  extended by net.objectlab.kit.datecalc.common.AbstractDateCalculator<Date>
      extended by net.objectlab.kit.datecalc.jdk.DateDateCalculator
All Implemented Interfaces:
DateCalculator<Date>

public class DateDateCalculator
extends AbstractDateCalculator<Date>

This class is used via the DateCalculator interface, it enables the handling of different HolidayHandler, if no HolidayHandler is defined, the calendar will NOT move a date, even if it falls on a holiday or weekend.

Version:
$Revision: 311 $ $Date: 2010-03-23 17:08:11 -0400 (Tue, 23 Mar 2010) $
Author:
Marcin Jekot, $LastModifiedBy$

Field Summary
 
Fields inherited from class net.objectlab.kit.datecalc.common.AbstractDateCalculator
DAYS_IN_WEEK
 
Constructor Summary
DateDateCalculator()
           
DateDateCalculator(String name, Date startDate, HolidayCalendar<Date> holidayCalendar, HolidayHandler<Date> holidayHandler)
           
 
Method Summary
protected  void checkBoundary(Date date)
           
protected  Date clone(Date date)
           
protected  Date compareDate(Date date1, Date date2, boolean returnEarliest)
           
protected  DateCalculator<Date> createNewCalculator(String name, Date startDate, HolidayCalendar<Date> holidays, HolidayHandler<Date> handler)
           
protected  Date getToday()
           
 boolean isWeekend(Date date)
          is the date a non-working day according to the WorkingWeek?
 DateCalculator<Date> moveByDays(int days)
           
protected  DateCalculator<Date> moveByMonths(int months)
           
 void setStartDate(Date startDate)
           
 void setWorkingWeek(WorkingWeek week)
           
 
Methods inherited from class net.objectlab.kit.datecalc.common.AbstractDateCalculator
calculateTenorDates, calculateTenorDates, combine, getCurrentBusinessDate, getCurrentIncrement, getHolidayCalendar, getHolidayHandler, getHolidayHandlerType, getName, getStartDate, isCurrentDateNonWorking, isNonWorkingDay, moveByBusinessDays, moveByTenor, moveByTenor, setCurrentBusinessDate, setCurrentIncrement, setHolidayCalendar, setHolidayHandler, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateDateCalculator

public DateDateCalculator()

DateDateCalculator

public DateDateCalculator(String name,
                          Date startDate,
                          HolidayCalendar<Date> holidayCalendar,
                          HolidayHandler<Date> holidayHandler)
Method Detail

setWorkingWeek

public void setWorkingWeek(WorkingWeek week)

isWeekend

public boolean isWeekend(Date date)
is the date a non-working day according to the WorkingWeek?


moveByDays

public DateCalculator<Date> moveByDays(int days)

createNewCalculator

protected DateCalculator<Date> createNewCalculator(String name,
                                                   Date startDate,
                                                   HolidayCalendar<Date> holidays,
                                                   HolidayHandler<Date> handler)
Specified by:
createNewCalculator in class AbstractDateCalculator<Date>

setStartDate

public final void setStartDate(Date startDate)
Specified by:
setStartDate in interface DateCalculator<Date>
Overrides:
setStartDate in class AbstractDateCalculator<Date>

getToday

protected final Date getToday()
Specified by:
getToday in class AbstractDateCalculator<Date>

moveByMonths

protected DateCalculator<Date> moveByMonths(int months)
Specified by:
moveByMonths in class AbstractDateCalculator<Date>

compareDate

protected Date compareDate(Date date1,
                           Date date2,
                           boolean returnEarliest)
Specified by:
compareDate in class AbstractDateCalculator<Date>

checkBoundary

protected void checkBoundary(Date date)
Specified by:
checkBoundary in class AbstractDateCalculator<Date>

clone

protected Date clone(Date date)
Specified by:
clone in class AbstractDateCalculator<Date>


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