pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.time
Class CalendarSheet

java.lang.Object
  extended by org.torweg.pulse.util.time.CalendarSheet

public class CalendarSheet
extends java.lang.Object

A result representing a "calendar sheet" for a month including the days "before the start" and "after the end" of the requested month which are required to complete the full week.

Version:
$Revision$
Author:
Daniel Dietz

Nested Class Summary
protected static class CalendarSheet.CalendarSheetDay
          Represents a day within the CalendarSheet based on the underlying Duration.
 
Constructor Summary
CalendarSheet()
          Default constructor.
CalendarSheet(long timeStamp)
          Creates a new CalendarSheetResult using the given time stamp as reference time stamp.
 
Method Summary
 java.util.Set<CalendarSheet.CalendarSheetDay> getCalendarSheetDays()
          Returns the CalendarSheetDays of the CalendarSheet.
protected  java.util.Collection<CalendarSheet.CalendarSheetDay> getCalendarSheetDays(CalendarSheet.CalendarSheetDay.SelectionMode selMode)
          Returns the CalendarSheetDays for the given CalendarSheetDay.SelectionMode.
 long getReferenceTimeStamp()
          Returns the reference time stamp of the CalendarSheet.
protected  Duration getSelectedPeriod(Period period)
          Returns a Duration representing the given Period of the CalendarSheet based on the underlying reference time stamp sorted by their underlying Duration.
 void setReferenceTimeStamp(long timeStamp)
          Sets the reference time stamp for the CalendarSheet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarSheet

public CalendarSheet()
Default constructor. Creates a new CalendarSheetResult using System.currentTimeMillis() as reference time stamp.


CalendarSheet

public CalendarSheet(long timeStamp)
Creates a new CalendarSheetResult using the given time stamp as reference time stamp.

Parameters:
timeStamp - the time stamp
Method Detail

getReferenceTimeStamp

public final long getReferenceTimeStamp()
Returns the reference time stamp of the CalendarSheet.

Returns:
the referenceTimeStamp

setReferenceTimeStamp

public final void setReferenceTimeStamp(long timeStamp)
Sets the reference time stamp for the CalendarSheet.

Parameters:
timeStamp - the time stamp

getSelectedPeriod

protected final Duration getSelectedPeriod(Period period)
Returns a Duration representing the given Period of the CalendarSheet based on the underlying reference time stamp sorted by their underlying Duration.

Parameters:
period - the Period
Returns:
a Duration representing the given Period sorted by their underlying Duration

getCalendarSheetDays

public final java.util.Set<CalendarSheet.CalendarSheetDay> getCalendarSheetDays()
Returns the CalendarSheetDays of the CalendarSheet.

Returns:
the CalendarSheetDays

getCalendarSheetDays

protected final java.util.Collection<CalendarSheet.CalendarSheetDay> getCalendarSheetDays(CalendarSheet.CalendarSheetDay.SelectionMode selMode)
Returns the CalendarSheetDays for the given CalendarSheetDay.SelectionMode.

Parameters:
selMode - the CalendarSheetDay.SelectionMode
Returns:
the CalendarSheetDays