Top Description Fields Constructors Methods
com.ibm.icu.util

public Class RangeDateRule

Additional top-level class in compilation unit: Range.

extends Object
implements DateRule
Class Inheritance
All Implemented Interfaces
com.ibm.icu.util.DateRule
Imports
java.util.ArrayList, .Date, .List

Note

The Holiday framework is a technology preview. Despite its age, is still draft API, and clients should treat it as such. Implementation of DateRule that takes a range.

ICU Status
Draft since ICU 2.8 (retainAll).

Field Summary

Modifier and TypeField and Description
pack-priv List<Range>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(DateRule rule)

public void
add(Date start, DateRule rule)

public Date
firstAfter(Date
Only occurrances on or after this date are returned.
start
)

Implements com.ibm.icu.util.DateRule.firstAfter.

Return the first occurrance of the event represented by this rule that is on or after the given start date.
public Date
firstBetween(Date
Only occurrances on or after this date are returned.
start
,
Date
Only occurrances before this date are returned.
end
)

Implements com.ibm.icu.util.DateRule.firstBetween.

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)

Implements com.ibm.icu.util.DateRule.isBetween.

Check whether this event occurs at least once between the two dates given.
public boolean
isOn(Date
The date to check.
date
)

Implements com.ibm.icu.util.DateRule.isOn.

Checks whether this event occurs on the given date.
private Range
rangeAt(int index)

private int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rangesback to summary
pack-priv List<Range> ranges

Constructor Detail

RangeDateRuleback to summary
public RangeDateRule()
ICU Status
Draft since ICU 2.8.

Method Detail

addback to summary
public void add(DateRule rule)
ICU Status
Draft since ICU 2.8.
addback to summary
public void add(Date start, DateRule rule)
ICU Status
Draft since ICU 2.8.
firstAfterback to summary
public Date firstAfter(Date start)

Implements com.ibm.icu.util.DateRule.firstAfter.

Doc from com.ibm.icu.util.DateRule.firstAfter.

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.

Annotations
@Override
ICU Status
Draft since ICU 2.8.
firstBetweenback to summary
public Date firstBetween(Date start, Date end)

Implements com.ibm.icu.util.DateRule.firstBetween.

Doc from com.ibm.icu.util.DateRule.firstBetween.

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.

Annotations
@Override
ICU Status
Draft since ICU 2.8.
isBetweenback to summary
public boolean isBetween(Date start, Date end)

Implements com.ibm.icu.util.DateRule.isBetween.

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

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

Implements com.ibm.icu.util.DateRule.isOn.

Doc from com.ibm.icu.util.DateRule.isOn.

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.

Annotations
@Override
ICU Status
Draft since ICU 2.8.
rangeAtback to summary
private Range rangeAt(int index)
startIndexback to summary
private int startIndex(Date start)