Package fr.marcwrobel.jbanking.calendar
Class CompositeCalendar
- java.lang.Object
-
- fr.marcwrobel.jbanking.calendar.CompositeCalendar
-
-
Field Summary
-
Fields inherited from interface fr.marcwrobel.jbanking.calendar.Calendar
MAX_ITERATIONS
-
-
Constructor Summary
Constructors Constructor Description CompositeCalendar(Calendar... calendars)Creates a new instance using the givenCalendars.CompositeCalendar(Collection<Calendar> calendars)Creates a new instance using the givenCalendars.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Holiday>getHolidaysFor(LocalDate date)Get all theHolidays matching with the given day.booleanisHoliday(LocalDate date)Check whether the given date is a public holiday.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.marcwrobel.jbanking.calendar.Calendar
businessDaysWithin, holidaysWithin, isBusinessDay, next, nextOrSame, previous, previousOrSame, shift
-
-
-
-
Constructor Detail
-
CompositeCalendar
public CompositeCalendar(Collection<Calendar> calendars)
Creates a new instance using the givenCalendars.- Parameters:
calendars- theCalendars to use in this composite calendar- Throws:
NullPointerException- ifcalendarsis {code null}IllegalArgumentException- ifcalendarsis empty
-
CompositeCalendar
public CompositeCalendar(Calendar... calendars)
Creates a new instance using the givenCalendars.- Parameters:
calendars- theCalendars to use in this composite calendar- Throws:
NullPointerException- ifcalendarsis {code null}IllegalArgumentException- ifcalendarsis empty
-
-
Method Detail
-
isHoliday
public boolean isHoliday(LocalDate date)
Description copied from interface:CalendarCheck whether the given date is a public holiday.- Specified by:
isHolidayin interfaceCalendar- Parameters:
date- a non-null date.- Returns:
trueif the given date is a holiday,falseotherwise.- See Also:
Calendar.isHoliday(LocalDate)
-
getHolidaysFor
public Set<Holiday> getHolidaysFor(LocalDate date)
Description copied from interface:CalendarGet all theHolidays matching with the given day.- Specified by:
getHolidaysForin interfaceCalendar- Parameters:
date- a non-null and unmodifiable set ofHolidays.- Returns:
trueif the given date is a holiday,falseotherwise.- See Also:
Calendar.getHolidaysFor(LocalDate)
-
-