An annual date rule where the generated date always falls on the same day
and month each year.
An example is ANZAC Day in Australia and New Zealand: it is observed on
25 April of every year.
| Method from org.jfree.date.DayAndMonthRule Detail: |
public SerialDate getDate(int yyyy) {
return SerialDate.createInstance(this.dayOfMonth, this.month, yyyy);
}
Returns the date, given the year. |
public int getDayOfMonth() {
return this.dayOfMonth;
}
Returns the day of the month. |
public int getMonth() {
return this.month;
}
Returns an integer code representing the month.
The codes JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST,
SEPTEMBER, OCTOBER, NOVEMBER and DECEMBER are defined in the SerialDate
class. |
public void setDayOfMonth(int dayOfMonth) {
// check arguments...
if ((dayOfMonth < 1) || (dayOfMonth > SerialDate.LAST_DAY_OF_MONTH[this.month])) {
throw new IllegalArgumentException(
"DayAndMonthRule(): dayOfMonth outside valid range.");
}
// make the change...
this.dayOfMonth = dayOfMonth;
}
Sets the day-of-the-month for this rule. |
public void setMonth(int month) {
// check arguments...
if (!SerialDate.isValidMonthCode(month)) {
throw new IllegalArgumentException("DayAndMonthRule(): month code not valid.");
}
// make the change...
this.month = month;
}
Sets the month for this rule. |