1 /***
2 * Created by IntelliJ IDEA.
3 * User: Lennart
4 * Date: 22-nov-2003
5 * Time: 16:18:21
6 */
7 package comics.interfaces;
8
9 import java.util.Calendar;
10 import java.util.Date;
11
12 /*
13 * CVS information:
14 *
15 * $Revision: 1.1 $
16 * $Date: 2003/12/04 14:29:45 $
17 */
18
19 /***
20 * This interface describes the behaviour for a class that rolls back days, based on a configurable
21 * algorithm. The default Calendar implementation used is the GregorianCalendar.
22 *
23 * @author Lennart Martens
24 */
25 public interface DayRoller {
26
27 /***
28 * This method allows the setting of a specific starting date via a specified Calendar.
29 * Note that this Calendar instance will subsequently be used for rolling through the days.
30 *
31 * @param aStartDate Calendar with the desired start date.
32 */
33 public void setStartDate(Calendar aStartDate);
34
35 /***
36 * This method allows the setting of a specific starting date via a specified Date.
37 * Note that a specific Calendar instance will be created for rolling through the days.
38 * Which Calendar instance is completely up to the implementation!
39 *
40 * @param aStartDate Calendar with the desired start date.
41 */
42 public void setStartDate(Date aStartDate);
43
44 /***
45 * This method allows the caller to specify which days should be reported.
46 *
47 * @param aDays int[] with the integer codes for days as specified by the constants
48 * in the Calendar interface.
49 */
50 public void setApplicableDays(int[] aDays);
51
52 /***
53 * This method returns the current date, or the first earlier applicable day.
54 *
55 * @return Calendar with the current date, or the first previous applicable day
56 */
57 public Calendar getCurrentDate();
58
59 /***
60 * This method returns the formatted current date, or the first earlier applicable day.
61 * Formatting will be applied according to the specified String using a SimpleDateFormatter.
62 *
63 * @return String with the formatted current date, or the first previous applicable day.
64 */
65 public String getFormattedCurrentDate(String aFormatter);
66
67 /***
68 * This method returns the current Calendar instance rolled back by the necessary amount of days
69 * to match the nearest previous applicable day.
70 *
71 * @return Calendar with the nearest previous applicable day
72 */
73 public Calendar getPreviousDay();
74
75 /***
76 * This method returns the current Calendar instance rolled forward by the necessary amount of days
77 * to match the nearest future applicable day.
78 *
79 * @return Calendar with the nearest future applicable day
80 */
81 public Calendar getNextDay();
82
83 /***
84 * This method returns the current day of month (1-31)
85 *
86 * @return int with the current day of the month (1-31)
87 */
88 public int getCurrentDayOfMonth();
89
90 /***
91 * This method returns the current month (1-12)
92 *
93 * @return int with the current month (1-12)
94 */
95 public int getCurrentMonth();
96
97 /***
98 * This method returns the current year (4-digit notation, eg. 2003)
99 *
100 * @return int with the current year (4-digit notation, eg. 2003)
101 */
102 public int getCurrentYear();
103 }
This page was automatically generated by Maven