Package com.ibm.icu.util
Class RangeDateRule
- java.lang.Object
-
- com.ibm.icu.util.RangeDateRule
-
- All Implemented Interfaces:
DateRule
public class RangeDateRule extends Object implements DateRule
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.- Status:
- Draft ICU 2.8 (retainAll).
-
-
Constructor Summary
Constructors Constructor Description RangeDateRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(DateRule rule)voidadd(Date start, DateRule rule)DatefirstAfter(Date start)Return the first occurrance of the event represented by this rule that is on or after the given start date.DatefirstBetween(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.booleanisBetween(Date start, Date end)Check whether this event occurs at least once between the two dates given.booleanisOn(Date date)Checks whether this event occurs on the given date.
-
-
-
Method Detail
-
add
public void add(DateRule rule)
- Status:
- Draft ICU 2.8.
-
firstAfter
public Date firstAfter(Date start)
Description copied from interface:DateRuleReturn the first occurrance of the event represented by this rule that is on or after the given start date.- Specified by:
firstAfterin interfaceDateRule- Parameters:
start- Only occurrances on or after this date are returned.- Returns:
- The date on which this event occurs, or null if it does not occur on or after the start date.
- See Also:
DateRule.firstBetween(java.util.Date, java.util.Date)- Status:
- Draft ICU 2.8.
-
firstBetween
public Date firstBetween(Date start, Date end)
Description copied from interface:DateRuleReturn 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.- Specified by:
firstBetweenin interfaceDateRule- Parameters:
start- Only occurrances on or after this date are returned.end- Only occurrances before this date are returned.- Returns:
- The date on which this event occurs, or null if it does not occur between the start and end dates.
- See Also:
DateRule.firstAfter(java.util.Date)- Status:
- Draft ICU 2.8.
-
isOn
public boolean isOn(Date date)
Description copied from interface:DateRuleChecks 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.
-
-