comics.interfaces
Interface DayRoller

All Known Implementing Classes:
GregorianDayRoller

public interface DayRoller

This interface describes the behaviour for a class that rolls back days, based on a configurable algorithm. The default Calendar implementation used is the GregorianCalendar.

Author:
Lennart Martens

Method Summary
 java.util.Calendar getCurrentDate()
          This method returns the current date, or the first earlier applicable day.
 int getCurrentDayOfMonth()
          This method returns the current day of month (1-31)
 int getCurrentMonth()
          This method returns the current month (1-12)
 int getCurrentYear()
          This method returns the current year (4-digit notation, eg. 2003)
 java.lang.String getFormattedCurrentDate(java.lang.String aFormatter)
          This method returns the formatted current date, or the first earlier applicable day.
 java.util.Calendar getNextDay()
          This method returns the current Calendar instance rolled forward by the necessary amount of days to match the nearest future applicable day.
 java.util.Calendar getPreviousDay()
          This method returns the current Calendar instance rolled back by the necessary amount of days to match the nearest previous applicable day.
 void setApplicableDays(int[] aDays)
          This method allows the caller to specify which days should be reported.
 void setStartDate(java.util.Calendar aStartDate)
          This method allows the setting of a specific starting date via a specified Calendar.
 void setStartDate(java.util.Date aStartDate)
          This method allows the setting of a specific starting date via a specified Date.
 

Method Detail

setStartDate

public void setStartDate(java.util.Calendar aStartDate)
This method allows the setting of a specific starting date via a specified Calendar. Note that this Calendar instance will subsequently be used for rolling through the days.

Parameters:
aStartDate - Calendar with the desired start date.

setStartDate

public void setStartDate(java.util.Date aStartDate)
This method allows the setting of a specific starting date via a specified Date. Note that a specific Calendar instance will be created for rolling through the days. Which Calendar instance is completely up to the implementation!

Parameters:
aStartDate - Calendar with the desired start date.

setApplicableDays

public void setApplicableDays(int[] aDays)
This method allows the caller to specify which days should be reported.

Parameters:
aDays - int[] with the integer codes for days as specified by the constants in the Calendar interface.

getCurrentDate

public java.util.Calendar getCurrentDate()
This method returns the current date, or the first earlier applicable day.

Returns:
Calendar with the current date, or the first previous applicable day

getFormattedCurrentDate

public java.lang.String getFormattedCurrentDate(java.lang.String aFormatter)
This method returns the formatted current date, or the first earlier applicable day. Formatting will be applied according to the specified String using a SimpleDateFormatter.

Returns:
String with the formatted current date, or the first previous applicable day.

getPreviousDay

public java.util.Calendar getPreviousDay()
This method returns the current Calendar instance rolled back by the necessary amount of days to match the nearest previous applicable day.

Returns:
Calendar with the nearest previous applicable day

getNextDay

public java.util.Calendar getNextDay()
This method returns the current Calendar instance rolled forward by the necessary amount of days to match the nearest future applicable day.

Returns:
Calendar with the nearest future applicable day

getCurrentDayOfMonth

public int getCurrentDayOfMonth()
This method returns the current day of month (1-31)

Returns:
int with the current day of the month (1-31)

getCurrentMonth

public int getCurrentMonth()
This method returns the current month (1-12)

Returns:
int with the current month (1-12)

getCurrentYear

public int getCurrentYear()
This method returns the current year (4-digit notation, eg. 2003)

Returns:
int with the current year (4-digit notation, eg. 2003)


Copyright © Lennart Martens. All Rights Reserved.