2 *******************************************************************************
\r
3 * Copyright (C) 1996-2010, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
8 package com.ibm.icu.util;
\r
10 import java.util.Date;
\r
13 * <b>Note:</b> The Holiday framework is a technology preview.
\r
14 * Despite its age, is still draft API, and clients should treat it as such.
\r
16 * DateRule is an interface for calculating the date of an event.
\r
17 * It supports both recurring events and those which occur only once.
\r
18 * DateRule is useful for storing information about holidays,
\r
19 * Daylight Savings Time rules, and other events such as meetings.
\r
21 * @see SimpleDateRule
\r
22 * @draft ICU 2.8 (retainAll)
\r
23 * @provisional This API might change or be removed in a future release.
\r
25 public interface DateRule
\r
28 * Return the first occurrance of the event represented by this rule
\r
29 * that is on or after the given start date.
\r
31 * @param start Only occurrances on or after this date are returned.
\r
33 * @return The date on which this event occurs, or null if it
\r
34 * does not occur on or after the start date.
\r
36 * @see #firstBetween
\r
38 * @provisional This API might change or be removed in a future release.
\r
40 abstract public Date firstAfter(Date start);
\r
43 * Return the first occurrance of the event represented by this rule
\r
44 * that is on or after the given start date and before the given
\r
47 * @param start Only occurrances on or after this date are returned.
\r
48 * @param end Only occurrances before this date are returned.
\r
50 * @return The date on which this event occurs, or null if it
\r
51 * does not occur between the start and end dates.
\r
55 * @provisional This API might change or be removed in a future release.
\r
57 abstract public Date firstBetween(Date start, Date end);
\r
60 * Checks whether this event occurs on the given date. This does
\r
61 * <em>not</em> take time of day into account; instead it checks
\r
62 * whether this event and the given date are on the same day.
\r
63 * This is useful for applications such as determining whether a given
\r
66 * @param date The date to check.
\r
67 * @return true if this event occurs on the given date.
\r
69 * @provisional This API might change or be removed in a future release.
\r
71 abstract public boolean isOn(Date date);
\r
74 * Check whether this event occurs at least once between the two
\r
77 * @provisional This API might change or be removed in a future release.
\r
79 abstract public boolean isBetween(Date start, Date end);
\r