public class DayOfWeekInMonthRule extends AnnualDateRule
Constructor and Description |
---|
DayOfWeekInMonthRule()
Default constructor: builds a rule for the first Monday in January by default.
|
DayOfWeekInMonthRule(int count,
int dayOfWeek,
int month)
Standard constructor: builds a rule with the specified attributes.
|
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Returns the 'count' for this rule (one of FIRST, SECOND, THIRD, FOURTH and LAST).
|
SerialDate |
getDate(int year)
Return the date for this rule, given the year.
|
int |
getDayOfWeek()
Returns the day-of-the-week for this rule (SerialDate.MONDAY, SerialDate.TUESDAY, etc.).
|
int |
getMonth()
Returns the month for this rule.
|
void |
setCount(int count)
Sets the 'count' for this rule (one of FIRST, SECOND, THIRD, FOURTH and LAST).
|
void |
setDayOfWeek(int dayOfWeek)
Sets the day-of-the-week for this rule.
|
void |
setMonth(int month)
Sets the month for this rule.
|
clone
public DayOfWeekInMonthRule()
public DayOfWeekInMonthRule(int count, int dayOfWeek, int month)
count
- one of: FIRST, SECOND, THIRD, FOURTH or LAST.dayOfWeek
- the day-of-the-week (SerialDate.MONDAY, SerialDate.TUESDAY, etc.).month
- the month (SerialDate.JANUARY, SerialDate.FEBRUARY, etc.).public int getCount()
public void setCount(int count)
count
- the 'count'.public int getDayOfWeek()
public void setDayOfWeek(int dayOfWeek)
dayOfWeek
- the day-of-the-week.public int getMonth()
public void setMonth(int month)
month
- the month (SerialDate.JANUARY, SerialDate.FEBRUARY, etc.).public SerialDate getDate(int year)
getDate
in class AnnualDateRule
year
- the year.