org.oddjob.arooa.utils
Class SpringSafeCalendar

java.lang.Object
  extended by org.oddjob.arooa.utils.SpringSafeCalendar
All Implemented Interfaces:
CalendarAdaptor

public class SpringSafeCalendar
extends Object
implements CalendarAdaptor

Provide a wrapper for a Calendar that moves all times in the Spring transition to Daylight Saving Time missing hour to the end of the boundary. The standard SimpleDateFormat parser moves 1:45am to 2:45am which means that 1:45 to 2:15 becomes 2:45 to 2:15 which is a backward interval. This adaptor will mean these times become 2:00 to 2:15.

All other times remain unchanged.

Author:
rob

Constructor Summary
SpringSafeCalendar()
           
SpringSafeCalendar(Calendar calendar)
           
SpringSafeCalendar(Date date, TimeZone timeZone)
           
 
Method Summary
 Date getDate()
          Get the date of the underlying Calendar.
 void set(int field, int value)
          Set a field in the Calendar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringSafeCalendar

public SpringSafeCalendar()

SpringSafeCalendar

public SpringSafeCalendar(Date date,
                          TimeZone timeZone)

SpringSafeCalendar

public SpringSafeCalendar(Calendar calendar)
Method Detail

set

public void set(int field,
                int value)
Description copied from interface: CalendarAdaptor
Set a field in the Calendar. The same as that from the Calendar class.

Specified by:
set in interface CalendarAdaptor
Parameters:
field - The field, as used by Calendar.
value - The value, as used by Calendar.

getDate

public Date getDate()
Description copied from interface: CalendarAdaptor
Get the date of the underlying Calendar.

Specified by:
getDate in interface CalendarAdaptor
Returns: