net.objectlab.kit.datecalc.joda
Class YearMonthDayDateCalculator

Package class diagram package YearMonthDayDateCalculator
java.lang.Object
  extended by net.objectlab.kit.datecalc.common.AbstractDateCalculator<YearMonthDay>
      extended by net.objectlab.kit.datecalc.joda.YearMonthDayDateCalculator
All Implemented Interfaces:
DateCalculator<YearMonthDay>

public class YearMonthDayDateCalculator
extends AbstractDateCalculator<YearMonthDay>

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: 300 $ $Date: 2010-03-18 16:09:14 -0400 (Thu, 18 Mar 2010) $
Author:
Benoit Xhenseval, $LastChangedBy: benoitx $

Field Summary
 
Fields inherited from class net.objectlab.kit.datecalc.common.AbstractDateCalculator
DAYS_IN_WEEK
 
Constructor Summary
YearMonthDayDateCalculator()
           
YearMonthDayDateCalculator(String name, YearMonthDay startDate, HolidayCalendar<YearMonthDay> nonWorkingDays, HolidayHandler<YearMonthDay> holidayHandler)
           
 
Method Summary
protected  void checkBoundary(YearMonthDay date)
           
protected  YearMonthDay clone(YearMonthDay date)
           
protected  YearMonthDay compareDate(YearMonthDay date1, YearMonthDay date2, boolean returnEarliest)
           
protected  DateCalculator<YearMonthDay> createNewCalculator(String name, YearMonthDay startDate, HolidayCalendar<YearMonthDay> holidays, HolidayHandler<YearMonthDay> handler)
           
protected  YearMonthDay getToday()
           
 boolean isWeekend(YearMonthDay date)
          is the date a non-working day according to the WorkingWeek?
 DateCalculator<YearMonthDay> moveByDays(int days)
           
protected  DateCalculator<YearMonthDay> moveByMonths(int months)
           
 void setStartDate(YearMonthDay 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

YearMonthDayDateCalculator

public YearMonthDayDateCalculator()

YearMonthDayDateCalculator

public YearMonthDayDateCalculator(String name,
                                  YearMonthDay startDate,
                                  HolidayCalendar<YearMonthDay> nonWorkingDays,
                                  HolidayHandler<YearMonthDay> holidayHandler)
Method Detail

setWorkingWeek

public void setWorkingWeek(WorkingWeek week)

isWeekend

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


moveByDays

public DateCalculator<YearMonthDay> moveByDays(int days)

createNewCalculator

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

setStartDate

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

getToday

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

moveByMonths

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

compareDate

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

checkBoundary

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

clone

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


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