com.ibm.util
Class RangeDateRule
java.lang.Object
|
+--com.ibm.util.RangeDateRule
- All Implemented Interfaces:
- DateRule
- public class RangeDateRule
- extends java.lang.Object
- implements DateRule
Method Summary |
void |
add(java.util.Date start,
DateRule rule)
|
void |
add(DateRule rule)
|
java.util.Date |
firstAfter(java.util.Date start)
Return the first occurrance of the event represented by this rule
that is on or after the given start date. |
java.util.Date |
firstBetween(java.util.Date start,
java.util.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. |
boolean |
isBetween(java.util.Date start,
java.util.Date end)
Check whether this event occurs at least once between the two
dates given. |
boolean |
isOn(java.util.Date date)
Checks whether this event occurs on the given date. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RangeDateRule
public RangeDateRule()
RangeDateRule
public RangeDateRule(com.ibm.util.Range[] ranges)
add
public void add(DateRule rule)
add
public void add(java.util.Date start,
DateRule rule)
firstAfter
public java.util.Date firstAfter(java.util.Date start)
- Description copied from interface:
DateRule
- Return the first occurrance of the event represented by this rule
that is on or after the given start date.
- Specified by:
firstAfter
in interface DateRule
- Following copied from interface:
com.ibm.util.DateRule
- 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)
firstBetween
public java.util.Date firstBetween(java.util.Date start,
java.util.Date end)
- Description copied from interface:
DateRule
- 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.
- Specified by:
firstBetween
in interface DateRule
- Following copied from interface:
com.ibm.util.DateRule
- 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)
isOn
public boolean isOn(java.util.Date date)
- Description copied from interface:
DateRule
- 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.
- Specified by:
isOn
in interface DateRule
- Following copied from interface:
com.ibm.util.DateRule
- Parameters:
date
- The date to check.- Returns:
- true if this event occurs on the given date.
isBetween
public boolean isBetween(java.util.Date start,
java.util.Date end)
- Check whether this event occurs at least once between the two
dates given.
- Specified by:
isBetween
in interface DateRule
Copyright (c) 2001 IBM Corporation and others.