Top Description Methods
com.ibm.icu.util

public Interface DateRule

Known Direct Implementers
com.ibm.icu.util.RangeDateRule, com.ibm.icu.util.SimpleDateRule, com.ibm.icu.util.Holiday, com.ibm.icu.util.EasterRule
Imports
java.util.Date

Note

The Holiday framework is a technology preview. Despite its age, is still draft API, and clients should treat it as such. DateRule is an interface for calculating the date of an event. It supports both recurring events and those which occur only once. DateRule is useful for storing information about holidays, Daylight Savings Time rules, and other events such as meetings.

ICU Status
Draft since ICU 2.8 (retainAll).
See Also
SimpleDateRule

Method Summary

Modifier and TypeMethod and Description
public Date

Returns:

The date on which this event occurs, or null if it does not occur on or after the start date.
firstAfter
(Date
Only occurrances on or after this date are returned.
start
)

Return the first occurrance of the event represented by this rule that is on or after the given start date.

public Date

Returns:

The date on which this event occurs, or null if it does not occur between the start and end dates.
firstBetween
(Date
Only occurrances on or after this date are returned.
start
,
Date
Only occurrances before this date are returned.
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.

public boolean
isBetween(Date start, Date end)

Check whether this event occurs at least once between the two dates given.

public boolean

Returns:

true if this event occurs on the given date.
isOn
(Date
The date to check.
date
)

Checks whether this event occurs on the given date.

Method Detail

firstAfterback to 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:Date

Only occurrances on or after this date are returned.

Returns:Date

The date on which this event occurs, or null if it does not occur on or after the start date.

ICU Status
Draft since ICU 2.8.
See Also
firstBetween
firstBetweenback to summary
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:Date

Only occurrances on or after this date are returned.

end:Date

Only occurrances before this date are returned.

Returns:Date

The date on which this event occurs, or null if it does not occur between the start and end dates.

ICU Status
Draft since ICU 2.8.
See Also
firstAfter
isBetweenback to summary
public boolean isBetween(Date start, Date end)

Check whether this event occurs at least once between the two dates given.

ICU Status
Draft since ICU 2.8.
isOnback to summary
public boolean isOn(Date date)

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:Date

The date to check.

Returns:boolean

true if this event occurs on the given date.

ICU Status
Draft since ICU 2.8.