org.jfree.date
public class RelativeDayOfWeekRule extends AnnualDateRule
For example, Good Friday can be specified as 'the Friday PRECEDING Easter Sunday'.
Constructor Summary | |
---|---|
RelativeDayOfWeekRule()
Default constructor - builds a rule for the Monday following 1 January. | |
RelativeDayOfWeekRule(AnnualDateRule subrule, int dayOfWeek, int relative)
Standard constructor - builds rule based on the supplied sub-rule.
|
Method Summary | |
---|---|
Object | clone()
Creates a clone of this rule.
|
SerialDate | getDate(int year)
Returns the date generated by this rule, for the specified year.
|
int | getDayOfWeek()
Returns the day-of-the-week for this rule.
|
int | getRelative()
Returns the 'relative' attribute, that determines *which*
day-of-the-week we are interested in (SerialDate.PRECEDING,
SerialDate.NEAREST or SerialDate.FOLLOWING).
|
AnnualDateRule | getSubrule()
Returns the sub-rule (also called the reference rule).
|
void | setDayOfWeek(int dayOfWeek)
Sets the day-of-the-week for this rule.
|
void | setRelative(int relative)
Sets the 'relative' attribute (SerialDate.PRECEDING, SerialDate.NEAREST,
SerialDate.FOLLOWING).
|
void | setSubrule(AnnualDateRule subrule)
Sets the sub-rule.
|
Parameters: subrule the rule that determines the reference date. dayOfWeek the day-of-the-week relative to the reference date. relative indicates *which* day-of-the-week (preceding, nearest or following).
Returns: a clone of this rule.
Throws: CloneNotSupportedException this should never happen.
Parameters: year the year (1900 <= year <= 9999).
Returns: The date generated by the rule for the given year (possibly
null
).
Returns: the day-of-the-week for this rule.
Returns: The 'relative' attribute.
Returns: The annual date rule that determines the reference date for this rule.
Parameters: dayOfWeek the day-of-the-week (SerialDate.MONDAY, SerialDate.TUESDAY, and so on).
Parameters: relative determines *which* day-of-the-week is selected by this rule.
Parameters: subrule the annual date rule that determines the reference date for this rule.