public class DayAndMonthRule extends AnnualDateRule
An example is ANZAC Day in Australia and New Zealand: it is observed on 25 April of every year.
Constructor and Description |
---|
DayAndMonthRule()
Default constructor: builds a DayAndMonthRule for 1 January.
|
DayAndMonthRule(int dayOfMonth,
int month)
Standard constructor: builds a DayAndMonthRule for the given
day-of-the-month and month.
|
Modifier and Type | Method and Description |
---|---|
SerialDate |
getDate(int yyyy)
Returns the date, given the year.
|
int |
getDayOfMonth()
Returns the day of the month.
|
int |
getMonth()
Returns an integer code representing the month.
|
void |
setDayOfMonth(int dayOfMonth)
Sets the day-of-the-month for this rule.
|
void |
setMonth(int month)
Sets the month for this rule.
|
clone
public DayAndMonthRule()
public DayAndMonthRule(int dayOfMonth, int month)
For the month parameter, use SerialDate.JANUARY, etc. Note that there are no checks to prevent you from entering an invalid combination (such as 31 February).
dayOfMonth
- the day of the month (in the range 1 to 31).month
- the month (use SerialDate.JANUARY, SerialDate.FEBRUARY etc.);public int getDayOfMonth()
public void setDayOfMonth(int dayOfMonth)
dayOfMonth
- the day-of-the-month.public int getMonth()
The codes JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER and DECEMBER are defined in the SerialDate class.
public void setMonth(int month)
month
- the month for this rule.public SerialDate getDate(int yyyy)
getDate
in class AnnualDateRule
yyyy
- the year.