net.objectlab.kit.datecalc.common
Class ImmutableHolidayCalendar<E>

Package class diagram package ImmutableHolidayCalendar
java.lang.Object
  extended by net.objectlab.kit.datecalc.common.ImmutableHolidayCalendar<E>
All Implemented Interfaces:
Serializable, HolidayCalendar<E>

public class ImmutableHolidayCalendar<E>
extends Object
implements HolidayCalendar<E>

This is an immutable holiday calendar, once given to a DateCalculator, a HolidayCalendar cannot be modified, it will throw UnsupportedOperationException.

Since:
1.1.0
Version:
$Revision: 200 $ $Date: 2006-10-10 21:15:58 +0100 (Tue, 10 Oct 2006) $
Author:
Benoit Xhenseval, $LastChangedBy: benoitx $
See Also:
Serialized Form

Constructor Summary
ImmutableHolidayCalendar(HolidayCalendar<E> delegate)
           
 
Method Summary
 E getEarlyBoundary()
          Returns the earliest date covered by this HolidayCalendar.
 Set<E> getHolidays()
          Returns an immutable set of holidays.
 E getLateBoundary()
          Returns the latest date covered by this HolidayCalendar.
 boolean isHoliday(E date)
          Check if a date is a holiday.
 void setEarlyBoundary(E earlyBoundary)
          Sets the earliest date (must be <= first date in holiday set)
 void setHolidays(Set<E> holidays)
          Takes a copy of the holidays and store it in an immutable set.
 void setLateBoundary(E lateBoundary)
          Sets the latest date (must be <= first date in holiday set)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableHolidayCalendar

public ImmutableHolidayCalendar(HolidayCalendar<E> delegate)
Method Detail

getEarlyBoundary

public E getEarlyBoundary()
Description copied from interface: HolidayCalendar
Returns the earliest date covered by this HolidayCalendar.

Specified by:
getEarlyBoundary in interface HolidayCalendar<E>
Returns:
the early (start) boundary of the holiday range
See Also:
HolidayCalendar.getEarlyBoundary()

getHolidays

public Set<E> getHolidays()
Description copied from interface: HolidayCalendar
Returns an immutable set of holidays.

Specified by:
getHolidays in interface HolidayCalendar<E>
Returns:
the set of holidays
See Also:
HolidayCalendar.getHolidays()

getLateBoundary

public E getLateBoundary()
Description copied from interface: HolidayCalendar
Returns the latest date covered by this HolidayCalendar.

Specified by:
getLateBoundary in interface HolidayCalendar<E>
Returns:
the late (end) boundary of the holiday range
See Also:
HolidayCalendar.getLateBoundary()

setEarlyBoundary

public void setEarlyBoundary(E earlyBoundary)
Description copied from interface: HolidayCalendar
Sets the earliest date (must be <= first date in holiday set)

Specified by:
setEarlyBoundary in interface HolidayCalendar<E>
Parameters:
earlyBoundary -
Throws:
UnsupportedOperationException - You cannot modify the early boundary, you need to use a new HolidayCalendar.
See Also:
HolidayCalendar.setEarlyBoundary(java.lang.Object)

setHolidays

public void setHolidays(Set<E> holidays)
Description copied from interface: HolidayCalendar
Takes a copy of the holidays and store it in an immutable set.

Specified by:
setHolidays in interface HolidayCalendar<E>
Parameters:
holidays -
Throws:
UnsupportedOperationException("You - cannot modify the holidays, you need to use a new HolidayCalendar.");
See Also:
HolidayCalendar.setHolidays(java.util.Set)

setLateBoundary

public void setLateBoundary(E lateBoundary)
Description copied from interface: HolidayCalendar
Sets the latest date (must be <= first date in holiday set)

Specified by:
setLateBoundary in interface HolidayCalendar<E>
Parameters:
lateBoundary -
Throws:
UnsupportedOperationException - You cannot modify the late boundary, you need to use a new HolidayCalendar.
See Also:
HolidayCalendar.setLateBoundary(java.lang.Object)

isHoliday

public boolean isHoliday(E date)
Description copied from interface: HolidayCalendar
Check if a date is a holiday.

Specified by:
isHoliday in interface HolidayCalendar<E>
Parameters:
date -
Returns:
See Also:
HolidayCalendar.isHoliday(java.lang.Object)


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