net.objectlab.kit.datecalc.joda
Class LocalDateCalculator

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

public class LocalDateCalculator
extends AbstractDateCalculator<LocalDate>

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:
Benoit Xhenseval, $LastChangedBy: marchy $

Field Summary
 
Fields inherited from class net.objectlab.kit.datecalc.common.AbstractDateCalculator
DAYS_IN_WEEK
 
Constructor Summary
LocalDateCalculator()
           
LocalDateCalculator(String name, LocalDate startDate, HolidayCalendar<LocalDate> holidayCalendar, HolidayHandler<LocalDate> holidayHandler)
           
 
Method Summary
protected  void checkBoundary(LocalDate date)
           
protected  LocalDate clone(LocalDate date)
           
protected  LocalDate compareDate(LocalDate date1, LocalDate date2, boolean returnEarliest)
           
protected  DateCalculator<LocalDate> createNewCalculator(String name, LocalDate startDate, HolidayCalendar<LocalDate> holidays, HolidayHandler<LocalDate> handler)
           
protected  LocalDate getToday()
           
 boolean isWeekend(LocalDate date)
          is the date a non-working day according to the WorkingWeek?
 DateCalculator<LocalDate> moveByDays(int days)
           
 DateCalculator<LocalDate> moveByMonths(int months)
           
 void setWorkingWeek(WorkingWeek week)
          Set the working 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, setStartDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalDateCalculator

public LocalDateCalculator()

LocalDateCalculator

public LocalDateCalculator(String name,
                           LocalDate startDate,
                           HolidayCalendar<LocalDate> holidayCalendar,
                           HolidayHandler<LocalDate> holidayHandler)
Method Detail

setWorkingWeek

public void setWorkingWeek(WorkingWeek week)
Set the working week.

Parameters:
week - the JodaWorkingWeek
Throws:
IllegalArgumentException - if the week is not a JodaWorkingWeek.

isWeekend

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


moveByDays

public DateCalculator<LocalDate> moveByDays(int days)

moveByMonths

public DateCalculator<LocalDate> moveByMonths(int months)
Specified by:
moveByMonths in class AbstractDateCalculator<LocalDate>

createNewCalculator

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

getToday

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

compareDate

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

checkBoundary

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

clone

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


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