| java.lang.Object com.ibm.icu.util.SimpleDateRule
SimpleDateRule | public class SimpleDateRule implements DateRule(Code) | | Simple implementation of DateRule.
|
Constructor Summary | |
public | SimpleDateRule(int month, int dayOfMonth) | | SimpleDateRule(int month, int dayOfMonth, Calendar cal) | public | SimpleDateRule(int month, int dayOfMonth, int dayOfWeek, boolean after) Construct a rule for a weekday within a month, e.g. |
Method Summary | |
public Date | firstAfter(Date start) Return the first occurrance of the event represented by this rule
that is on or after the given start date.
Parameters: start - Only occurrances on or after this date are returned. | public Date | firstBetween(Date start, Date end) 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.
Parameters: start - Only occurrances on or after this date are returned. Parameters: end - Only occurrances before this date are returned. | public boolean | isBetween(Date start, Date end) Check whether this event occurs at least once between the two
dates given. | public boolean | isOn(Date date) Checks whether this event occurs on the given date. |
SimpleDateRule | public SimpleDateRule(int month, int dayOfMonth)(Code) | | Construct a rule for a fixed date within a month
Parameters: month - The month in which this rule occurs (0-based). Parameters: dayOfMonth - The date in that month (1-based). |
SimpleDateRule | SimpleDateRule(int month, int dayOfMonth, Calendar cal)(Code) | | |
SimpleDateRule | public SimpleDateRule(int month, int dayOfMonth, int dayOfWeek, boolean after)(Code) | | Construct a rule for a weekday within a month, e.g. the first Monday.
Parameters: month - The month in which this rule occurs (0-based). Parameters: dayOfMonth - A date within that month (1-based). Parameters: dayOfWeek - The day of the week on which this rule occurs. Parameters: after - If true, this rule selects the first dayOfWeekon or after dayOfMonth. If false, the rule selectsthe first dayOfWeek on or before dayOfMonth. |
firstAfter | public Date firstAfter(Date start)(Code) | | Return the first occurrance of the event represented by this rule
that is on or after the given start date.
Parameters: start - Only occurrances on or after this date are returned. The date on which this event occurs, or null if itdoes not occur on or after the start date. See Also: SimpleDateRule.firstBetween |
firstBetween | public Date firstBetween(Date start, Date end)(Code) | | 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.
Parameters: start - Only occurrances on or after this date are returned. Parameters: end - Only occurrances before this date are returned. The date on which this event occurs, or null if itdoes not occur between the start and end dates. See Also: SimpleDateRule.firstAfter |
isBetween | public boolean isBetween(Date start, Date end)(Code) | | Check whether this event occurs at least once between the two
dates given.
|
isOn | public boolean isOn(Date date)(Code) | | 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.
Parameters: date - The date to check. true if this event occurs on the given date. |
|
|