Holger's
Java API

com.antelmann.calendar
Class HolidayCalendar

java.lang.Object
  extended by com.antelmann.calendar.HolidayCalendar
All Implemented Interfaces:
Serializable, Iterable<Holiday>

public class HolidayCalendar
extends Object
implements Serializable, Iterable<Holiday>

maintains a list of days that represent holidays. All Date objects contained are stored as the time of that day at 12:00 am.

Since:
Feb 2006
Author:
Holger Antelmann
See Also:
CalendarHelper.dayBegin(java.util.Date), Serialized Form

Constructor Summary
HolidayCalendar()
           
HolidayCalendar(Collection<? extends Holiday> col)
           
 
Method Summary
 boolean addAll(Collection<? extends Holiday> col)
           
 boolean addHoliday(Holiday holiday)
           
 SortedSet<Holiday> getHolidays()
          returns an unmodifiable view of all holidays
 SortedSet<Holiday> getHolidays(Date date)
          returns the holidays for the given day
 SortedSet<Holiday> getHolidays(Date from, Date until)
          returns all holidays within the given range (inclusive day begin from, exclusive until)
 boolean isPublicHoliday(Date date)
           
 Iterator<Holiday> iterator()
           
 boolean removeHoliday(Holiday holiday)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HolidayCalendar

public HolidayCalendar()

HolidayCalendar

public HolidayCalendar(Collection<? extends Holiday> col)
Method Detail

addAll

public boolean addAll(Collection<? extends Holiday> col)

addHoliday

public boolean addHoliday(Holiday holiday)

removeHoliday

public boolean removeHoliday(Holiday holiday)

isPublicHoliday

public boolean isPublicHoliday(Date date)

getHolidays

public SortedSet<Holiday> getHolidays()
returns an unmodifiable view of all holidays


getHolidays

public SortedSet<Holiday> getHolidays(Date date)
returns the holidays for the given day


getHolidays

public SortedSet<Holiday> getHolidays(Date from,
                                      Date until)
returns all holidays within the given range (inclusive day begin from, exclusive until)


iterator

public Iterator<Holiday> iterator()
Specified by:
iterator in interface Iterable<Holiday>


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads