Note
The Holiday framework is a technology preview. Despite its age, is still draft API, and clients should treat it as such. Simple implementation of DateRule.
| Modifier and Type | Field and Description |
|---|---|
| private Calendar | |
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | SimpleDateRule(int
The month in which this rule occurs (0-based). month, int The date in that month (1-based). dayOfMonth)Construct a rule for a fixed date within a month |
| pack-priv | |
| public | SimpleDateRule(int
The month in which this rule occurs (0-based). month, int A date within that month (1-based). dayOfMonth, int The day of the week on which this rule occurs. dayOfWeek, boolean If true, this rule selects the first dayOfWeek
on or after dayOfMonth. If false, the rule selects
the first dayOfWeek on or before dayOfMonth. after)Construct a rule for a weekday within a month, e.g. the first Monday. |
| Modifier and Type | Method and Description |
|---|---|
| private Date | |
| private Date | |
| public Date | Returns: The date on which this event occurs, or null if it does not occur on or after the start date.Only occurrances on or after this date are returned. start)Implements com. |
| public Date | Returns: The date on which this event occurs, or null if it does not occur between the start and end dates.Only occurrances on or after this date are returned. start, Date Only occurrances before this date are returned. end)Implements com. |
| public boolean | isBetween(Date start, Date end)
Implements com. |
| public boolean | Returns: true if this event occurs on the given date.The date to check. date)Implements com. |
| calendar | back to summary |
|---|---|
| private Calendar calendar | |
| dayOfMonth | back to summary |
|---|---|
| private int dayOfMonth | |
| dayOfWeek | back to summary |
|---|---|
| private int dayOfWeek | |
| month | back to summary |
|---|---|
| private int month | |
| SimpleDateRule | back to summary |
|---|---|
| public SimpleDateRule(int month, int dayOfMonth) Construct a rule for a fixed date within a month
| |
| SimpleDateRule | back to summary |
|---|---|
| pack-priv SimpleDateRule(int month, int dayOfMonth, Calendar cal) | |
| SimpleDateRule | back to summary |
|---|---|
| public SimpleDateRule(int month, int dayOfMonth, int dayOfWeek, boolean after) Construct a rule for a weekday within a month, e.g. the first Monday.
| |
| computeInYear | back to summary |
|---|---|
| private Date computeInYear(int year, Calendar c) | |
| doFirstBetween | back to summary |
|---|---|
| private Date doFirstBetween(Date start, Date end) | |
| firstAfter | back to summary |
|---|---|
| public Date firstAfter(Date start) Implements com. Return the first occurrance of the event represented by this rule that is on or after the given start date.
| |
| firstBetween | back to summary |
|---|---|
| public Date firstBetween(Date start, Date end) Implements com. Return the first occurrance of the event represented by this rule that is on or after the given start date and before the given end date.
| |
| isBetween | back to summary |
|---|---|
| public boolean isBetween(Date start, Date end) Implements com. Check whether this event occurs at least once between the two dates given. | |
| isOn | back to summary |
|---|---|
| public boolean isOn(Date date) Implements com. Checks whether this event occurs on the given date. This does not take time of day into account; instead it checks whether this event and the given date are on the same day. This is useful for applications such as determining whether a given day is a holiday. | |